What are the best SEO framework / plugins for a WordPress Site: Genesis, Yoast Plugin, etc ?

What are the best SEO framework / plugins for a WordPress Site: Genesis, Yoast Plugin, etc ?

plugin development – wp_editor not working in Visual mode and becomes empty on save

I have created a custom widget, and want to transform the textarea into a wysiwyg editor.

The widget looks like this, I’ve stripped out all the unnecessary parts.

class Sponsor_Widget extends WP_Widget {

  function __construct() {
    $widget_ops = array('classname' => 'sponsor_widget', 'description' => __('Widget to display a Sponsor in the Secondary Widget Area.'));
    $control_ops = array('width' => 400, 'height' => 350);
    parent::__construct('sponsor_widget', __('Sponsor Widget'), $widget_ops, $control_ops);
  }

  function widget( $args, $instance ) {
    extract($args);
    // Other fields (Removed)

    $text = apply_filters( 'widget_text', empty( $instance('text') ) ? '' : $instance('text'), $instance );

    echo $before_widget;

    echo $text;

    echo $after_widget;
  }

  function update( $new_instance, $old_instance ) {
    $instance = $old_instance;
    // Other fields (Removed)
    $instance('text') =  $new_instance('text');
    
    return $instance;
  }



  function form( $instance ) {
    $instance = wp_parse_args( (array) $instance, array( 'sponsor_tier' => '5', 'sponsor_color' => '', 'sponsor_name' => '', 'logo_image' => '', 'logo_imageID' => '', 'linkpage' => '', 'text' => '' ) );
    // Other fields (Removed)

    $text = $instance('text');

    ?>
    
    <p>
      <label for="<?php echo $this->get_field_id('text'); ?>"><?php _e( 'About Sponsor:' ); ?></label>
      <?php
        $textAreaName = $this->get_field_name('text');
        $textAreaId = $this->get_field_id('text');
        $textAreaId = str_replace("-", "", $textAreaId);
        $textAreaId = str_replace("_", "", $textAreaId);

        $settings  = array(
          'media_buttons' => false,
          'teeny'         => true,
          'textarea_name' => $textAreaName,
          'textarea_rows' => 3,
          'tinymce'             => true,
        );

        wp_editor( $text, $textAreaId, $settings );
      ?>
    </p>

  <?php
  }
}

Now the editor appears and has the content loaded, but editing inside the visual box does not allow me to save the content, because the change event doesn’t seem to be triggered on the textarea.

If I Switch to text mode and make a few edits, I can now save the content, and it saves correctly, but after the widget refreshes the editor becomes blank. As though it’s not re-initialized after the ajax refresh?

enter image description here

  1. I don’t have any errors in the console
  2. I’ve tried deactivating all plugins
  3. I even went ahead and stripped all _ and – from teh textAreaId thinking maybe it didn’t like those, but that’s not it either.

Do you use the Squirrly SEO plugin for WordPress? How does it compare with Yoast and Ultimate SEO?

Do you use the Squirrly SEO plugin for WordPress? How does it compare with Yoast and Ultimate SEO?

plugin development – How to get taxonomy list by custom post id via REST API?

I have an issue with custom post types taxonomies.

I can’t get taxonomy by the custom post id, instead I’m getting all taxonomies list, even if custom post hasn’t any taxonomy.

I tried: /wp-json/wp/v2/portfolio_tag?portfolio=2842

It works for posts: /wp-json/wp/v2/tags?post=2842, but not for custom taxonomies.

How can I get it right?

My taxonomies are exposed for the REST API.

How to fix a The “tag” plugin does not exist error

when trying to access the home page of my site i am getting this error:

[Wed Jul 01 13:20:49.209695 2020] [lsapi:notice] [pid 8961:tid 47660541200128] [client 176.248.77.183:60826] Backend log: Uncaught PHP Exception DrupalComponentPluginExceptionPluginNotFoundException: “The “tag” plugin does not exist. Valid plugin IDs for DrupalviewsPluginViewsPluginManager are: ” at /home/sitename/public_html/core/lib/Drupal/Component/Plugin/Discovery/DiscoveryTrait.php line 53n

every other page works fine.

any idea what i can do to fix this?
this is a drupal 8 site

plugins – WordPress Plug-In to create database for members to choose items from and build their own page?

I am trying to create a site where a member can log in to their account and create their own page filled with their favorite products of a certain category.

Is it possible for me to create a master list with all of the possible products to choose from and then a member to go in and pick from categorized drop downs the items they want and drag and drop it to their member page?

I would like for the master list to link to the websites where the items can be found so that i dont have to download all of the images of every product and was hoping the link of the product could automate the image.

This would basically be like an amazon “favorites” page but from items that come from many different websites so that members have the products all in one place.

Is this something that would be possible for me to do with a wordpress plug-in?

Thank you for your help!

Let’s Encrypt cPanel Plugin | Web Hosting Talk

Registration at Web Hosting Talk is completely free and takes only a few seconds. By registering you’ll gain:

– Full Posting Privileges.

– Access to Private Messaging.

– Optional Email Notification.

– Ability to Fully Participate.

– And Much More.

Register Now, or check out the Site Tour and find out everything Web Hosting Talk has to offer.

Is the Yoast or Rank Math plugin better for WordPress SEO?


Is the Yoast or Rank Math plugin better for WordPress SEO?

plugin development – Insert, update or remove data from database (usermeta)

I have a situation here. I’m writing a custom plugin for WordPress. I’m dealing with an issue:

I’v created a metabox for Custom Post Type with add_meta_box and with a callback function where I generate a multiselect box. All users showing up with a user ID. The point is: The Custom Post Type is a group and this group can have multiple members (users). The first thing what I tried was saving all the users, which are subscribed to this group, in one single row in the postmeta table but that’s not a good solution.

What I want to do now is: Create a new row, for every single user, in the usermeta table with this key _enroll_user_value_key.

My field:
echo '<select multiple name="enroll_user_field()" id="enroll_user_field">'; this values, I want to pass this, for each single selected user, to a new database row in user_meta. Now I use only this function to save this data: update_user_meta( $enroll_user_data, '_enroll_user_value_key', $post->ID ); But when I select multiple users the row doesn’t update or created because there a multiple values passed from the field enroll_user_field().

How could I fix this? Should I create a foreach loop and repeat the update_user_meta every single time, for each selected user? And what if I remove a user from the group, should I use a seperate delete function or query for this?

How to keep users unique id stored in session in addition to IP in WordPress plugin?

I want to get likes from two computers with the same IP in the post like plugin I developed for wordpress. Currently my plugin is working but when I like a post from a device with the same IP, the dislike button appears in the other device. How can i prevent this ?

Here is my main plugin file (.php):

<?php
/**
Plugin Name: LikeMyPost
Plugin URI:  https://github.com/basarballioz/Like-My-Post-WPPlugin
Description: It allows users to create a button that will make them like the posts, and monitor which tags are mostly liked.
Version:     1.0
Author:      Başar Ballıöz
Author URI:  https://github.com/basarballioz
License:     GPLv3
License URI: https://www.gnu.org/licenses/gpl-3.0.tr.html
 **/


//This will prevent public user to access your hidden files directly by using URL.
if (!defined('ABSPATH') ) {
    exit;
}

// Load plugin files
require_once plugin_dir_path(__FILE__) . 'likemypost-widget.php';           // plugin widget
require_once plugin_dir_path( __FILE__ ) . 'likemypost-admin.php';          // admin menu entry and page content

class likeMyPost {
    
    //REGISTER STYLE AND JQUERY
    public function register_script() {
        //($handle, $src, $deps, $ver, $media) 
        wp_register_script('lmpScript', plugins_url('js/lmpscript.js', __FILE__), array('jquery'), '3.5.1' );       
        wp_localize_script('lmpScript', 'LMPajax',
        array('ajax_url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('worldsBestPluginEver'))); //SAFETY
    }

    public function loadScripts(){
        wp_enqueue_script('lmpScript');
    }

    //ADD A LIKE BUTTON TO BOTTOM OF THE POSTS
    public function addLikeButton($content) {
        if (get_post_type() == is_singular()) {
            $getPost = '<p class="getPostLiked" style="font-size: 1.1em; border-style: solid; border-width: thin; width: 200px"> You can, ';
        if ($this->alreadyLiked(get_the_ID())) {
            $getPost .= '<br> <a style="color: pink;" data-event="dislike" data-post_id="'.get_the_ID().'" href="#/"> Dislike this post ';
        } else {
            $getPost .= '<br> <a style="color: pink;" data-event="like" data-post_id="'.get_the_ID().'" href="#/"> Like this post! ';
        }
            $getPost .= '</a><span class="count">'.$this->likeCounter(get_the_ID());
            $getPost .= ' Likes <p></p></span></p>';
            $content .= $getPost;
        }
        return $content;
    }

    //AJAX RESPONSE
    public function like() {
        //SAFETY
        check_ajax_referer('worldsBestPluginEver', 'nonce');
        
        $post_id = $_POST('post_id');
        $event = $_POST('event');
        if ($event == "like") {
            $this->likePost($post_id);
        } else {
            $this->dislikePost($post_id);
        }
        die();
    }

    //IP CONTROL FOR ALREADY LIKED
    public function alreadyLiked($post_id) {
        $user_IP = $_SERVER('REMOTE_ADDR');
        $meta_IP = get_post_meta($post_id, '_likers_IP');
        $likers_IP = $meta_IP(0);
        
        //SAFE ARRAYS (allows us to display the counter as zero when creating a new post - in order to prevent errors)
        if (!is_array($likers_IP)) {
            $likers_IP = array();
        }
        if (in_array($user_IP, $likers_IP)) {
            return true;                        //ALREADY LIKED (SHOW "like") button
        } else {
            return false;                       //SHOW "dislike" button
        }
    }

    //LIKING POSTS BY USING $POSTID
    public function likePost($post_id) {
        $likes_count = $this->likeCounter($post_id);
        $user_IP = $_SERVER('REMOTE_ADDR');
        $meta_IP = get_post_meta($post_id,'_likers_IP');
        $likers_IP = $meta_IP(0);

        //SAFE ARRAYS
        if (!is_array($likers_IP)) {
            $likers_IP = array();
        }
        $likers_IP() = $user_IP;
        
        if (update_post_meta($post_id, '_likes_count', ++$likes_count)) {
            update_post_meta($post_id, '_likers_IP', $likers_IP);
            echo " ";
            echo "$likes_count Likes";
        } else {
            echo "Try again please...";
        }
    }

    //DISLIKING POSTS BY USING $POSTID
    public function dislikePost($post_id) {
        
        $likes_count = $this->likeCounter($post_id);
        $user_IP = $_SERVER('REMOTE_ADDR');
        $meta_IP = get_post_meta($post_id,'_likers_IP');
        $likers_IP = $meta_IP(0);

        //SAFE ARRAYS
        if (!is_array($likers_IP)) {
            $likers_IP = array();
        }
        if ($this->alreadyLiked($post_id)) {
            $key = array_search($user_IP,$likers_IP);
            unset($likers_IP($key));
        }
        if (update_post_meta($post_id, '_likes_count', --$likes_count)) {
            update_post_meta($post_id, '_likers_IP', $likers_IP);
            echo " ";
            echo "$likes_count Likes";
        } else {
            echo "Try again please...";
        }
    }

    public function likeCounter($post_id) {
        return get_post_meta($post_id, '_likes_count', true);
    }

    //HOOKS
    public function run() {      
        add_action('init', array($this,'register_script'));
        add_action('wp_enqueue_scripts', array($this,'loadScripts'));

        add_filter('the_content', array($this, 'addLikeButton' ));

        add_action('wp_ajax_nopriv_like', array($this,'like'));
        add_action('wp_ajax_like', array($this,'like'));
    }
}

//LIKE MY POST PLUGIN INITIALIZER
$plugin = new likeMyPost();  //Plugin object
$plugin->run();              //Call run function

And it is my jquery file:

jQuery(document).ready(function () {
   jQuery('.getPostLiked a').click(function () {
       
       let likeButton = jQuery(this);
       let post_id = likeButton.data('post_id');
       let event = likeButton.data('event');
       
       if (event == 'like') {
          likeButton.text('Dislike this post!');
          likeButton.data('event','unlike');
       } else {
          likeButton.text('Like this post!');
          likeButton.data('event','like');
       }
       
       jQuery.ajax({
           type : 'post',
           url : LMPajax.ajax_url,
           data : {
               action : 'like',
               post_id : post_id,
               event : event,
               nonce : LMPajax.nonce
           },
           success : function (response) {   //WHEN ENDS
                        jQuery('.count').text(response);
                     }
        });
    });
});