Forum Replies Created

Viewing 10 replies - 1 through 10 (of 10 total)
  • Forum: Plugins
    In reply to: [Safari Push] No popup
    Thread Starter Eric Liddon

    (@eliddon)

    So I found my issue. It wasn’t with this plugin but my server side config. My WEBSITE_NAME did not match what I had configured the name for Push ID I created on the apple developer portal.

    I had the same issue when using the tinymce editor on the front end. The latest version of WordPress is using an updated Jquery and Jquery-ui.

    I was loading a later version of jquery & jquery-ui since I required it for some plugins. In doing so I was deregistering “jquery-ui-core” on the front end, and registering my own version so I could use some other stuff. This didn’t have an issue, but it appears tinymce would try to load its js plugins with a dependency on the existing jquery-ui-core (or others that depended on it).

    Check your theme to see if it has used wp_deregister_script() anywhere, and check if it is deregistering any of the jquery-ui js libraries.

    I’d also check to make sure jquery or jquery-ui is not being loaded twice as that may also cause some issues similar to this.

    If you check out your code markup on your page, check to see what scripts wp-load-scripts.php is loading if you are missing any of the following I would assume your issue is either a conflict with versions or dependency not loading.

    editor
    jquery-ui-core
    jquery-ui-widget
    jquery-ui-resizable
    jquery-ui-draggable
    jquery-ui-button
    jquery-ui-position
    jquery-ui-dialog
    wpdialogs
    wplink
    wpdialogs-popup

    It most likely is loading more, but I would start with those to see if they are there.

    You could try using wp_enqueue_script() to register them as well if they aren’t there. If you are in the Admin panel though this should be loaded automatically if you are in an edit or create post/page. Even on the front end most of the stuff loads automatically when you load a tinymce from wp_editor()

    Hope this helps you fix your issue.

    I was able to, although when I reverted back to 4.2.8 I tried to reset the Analytics Profile using the automatic method (in which it failed – not sure what the error message was), so I entered my UA code in manually then did the upgrade and I didn’t have an issue after that…

    Not sure if this will resolve anyone’s issue, but I upgraded from 4.2.8 to 4.3.2, had the issue, then uploaded 4.2.8 back over top and then re-did the upgrade and the error went away…

    So figured my issue, In my filter:

    add_filter(‘yoast-ga-custom-vars’,’add_ga_custom_vars’,10,2);

    I had the following for my function declaration:
    function add_ga_custom_vars($push, &$customvarslot) {

    Passing by reference was depreciated in php 5.3 and removed in 5.4 (see Here

    So I had a similar issue. Everything worked fine on 4.2.8 Then I upgraded PHP to 5.3 (from 5.2.17) and I recieved this error:

    Warning: Parameter 2 to add_ga_custom_vars() expected to be a reference, value given in …/wp-includes/plugin.php on line 173

    So I tried upgrading to 4.3.2 of the plugin and I received the error:
    Fatal error: Cannot use string offset as an array in …/wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 344

    I had a custom filter to add custom vars using the following in my functions.php in my theme folder:
    add_filter(‘yoast-ga-custom-vars’,’add_ga_custom_vars’,10,2);

    (I didn’t include function yet).

    Once I disabled this filter I had neither error mentioned above…

    I figured it out… You can use something like the code below:

    add_filter('yoast-ga-custom-vars','add_ga_custom_vars',10,2);
    
    function add_ga_custom_vars($push, &$customvarslot) {
       $my_custom_val = "whaterver";
    $push[] = "'_setCustomVar',".$customvarslot.",'My_Custom_Variable','".$my_custom_val."',3";
       $customvarslot++;
       return $push;
    }

    This worked for me. Hope it helps someone else.

    Did you ever find a solution for this? I want to do the same thing…

    Thread Starter Eric Liddon

    (@eliddon)

    It is not letting me edit my earlier post, but just wanted to forewarn people Do not run that code to Delete the featured image. Using the wp_delete_attachment will also cause it to delete the First Image of every post. If a moderator sees this maybe they can remove that part from above.

    I didn’t notice the issue because when I re-ran Auto Post Thumbnail from my dev site it was using my production site to grab the Thumbnails and would recreate all the images properly. When I ran it on production… not so lucky πŸ™‚

    Thread Starter Eric Liddon

    (@eliddon)

    To fix the wp-image tags we can do the following (Note, this will only fix the ones for the image that Auto Post Thumbnail creates) Also this includes the fix above.

    After (around line 263)

    preg_match('/wp-image-([\d]*)/i', $image, $thumb_id);
    $thumb_id = $thumb_id[1];

    Add:

    $old_thumb_id = $thumb_id;
    
    * Check if $thumb_id actually exists in DB */
    if ($thumb_id) {
      $result = $wpdb->get_results("Select ID FROM {$wpdb->posts} WHERE ID = '".$thumb_id."'");
      if (!$result)
        unset($thumb_id);
    }

    Then After (around line 287)

    if ($thumb_id) {
      update_post_meta( $post_id, '_thumbnail_id', $thumb_id );

    Add:

    /* Fix Image class tag in Post wp-image-#### */
    if ($old_thumb_id) {
      $updated_post = array();
      $updated_post['ID'] = $post_id;
      $updated_post['post_content'] = preg_replace('/wp-image-'.$old_thumb_id.'/i','wp-image-'.$thumb_id,$post[0]->post_content);
      wp_update_post( $updated_post );
    }

    Just to sum up, I ran into this problem because I wanted to resize all my thumbnails larger (and the regenerate thumbnails plugin didn’t reset the featured image).

    So I ran the followign code (from a .php file in the root)

    require_once("wp-load.php");
    echo 'Working... '; ob_flush();
    global $wpdb;
    $attachments = $wpdb->get_results("SELECT * FROM $wpdb->postmeta WHERE meta_key = '_thumbnail_id'");
    foreach($attachments as $attachment){
         $wpdb->query("DELETE FROM $wpdb->postmeta WHERE meta_id = '$attachment->meta_id' LIMIT 1");
         wp_delete_attachment($attachment->meta_value, true);
    }
    echo 'done!';

    Code was found from Here

    Note, I don’t recommend deleting your previous thumbnails as it will effect your SEO on your images since essentially they are new images. Although I’m not entirely sure how you would increase your thumbnail size without impacting your SEO on the images.

    Hopefully this helps someone!

Viewing 10 replies - 1 through 10 (of 10 total)