Support » Plugin: Simple Image Sizes » Class not found error updating to version 3.2.1

  • Resolved nort99

    (@nort99)


    Hi,

    I’ve worked around this problem but I wanted to post it in case it helps other people. I update plugins on a development environment, push those changes to Git, and then deploy those changes to the staging and live servers. When I updated to version 3.2.1 on my development environment I had no issues. However when I pushed that update from Git to my staging server I received a class not found error and the site became unreachable.

    ——————————————————————
    An error of type E_ERROR was caused in line 42 of the file /var/www/vhosts/acme.co.uk/httpdocs/wp-content/plugins/simple-image-sizes/simple_image_sizes.php. Error message: Uncaught Error: Class ‘Rahe\Simple_Image_Sizes\Main’ not found in /var/www/vhosts/acme.co.uk/httpdocs/wp-content/plugins/simple-image-sizes/simple_image_sizes.php:42
    ——————————————————————

    WORKAROUND: I found that the workaround is you have to actually update the plugin on the server. I’m guessing it does something during that process that is separate from the files that get updated. Once the plugin has been updated on the server, I was able to push my update across as normal, and get back to essentially the same position.

    It would be great if this issue could be avoided in future for those of us using source control.

    Thanks

    • This topic was modified 1 year, 9 months ago by nort99.
Viewing 4 replies - 1 through 4 (of 4 total)
  • I had the same problem. It looks like the case got changed for some file names.

    Example:
    wp-content/plugins/simple-image-sizes/classes/main.php
    is now
    wp-content/plugins/simple-image-sizes/classes/Main.php

    I discovered that, by default, Git doesn’t care about case. You need to configure your repository to be aware of case:
    git config core.ignorecase false

    Thread Starter nort99

    (@nort99)

    Thanks gmetais. That was the problem. I checked my server and I now have two versions of the class one main.php and one Main.php. The latter must have bee written there by updating the plugin via the server. I’ll be updating my git config to prevent this in future.

    • This reply was modified 1 year, 9 months ago by nort99.

    Could anyone explain how to make this change (in detals please)
    🙂

    My error

    Error E_ERROR in line 56 in this file /home/k/o/ftp_xxxxxxxxcom/wp-content/plugins/simple-image-sizes/simple_image_sizes.php.

    Errormessage: Uncaught Error: Class ‘SIS_Admin_Main’ not found in /home/k/o/ftp_xxxxxxxxcom/wp-content/plugins/simple-image-sizes/simple_image_sizes.php:56
    Stack trace:
    #0 /home/k/o/ftp_xxxxxxxxcom/wp-includes/class-wp-hook.php(286): init_sis(”)
    #1 /home/k/o/ftp_xxxxxxxxcom/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array)
    #2 /home/k/o/ftp_xxxxxxxxcom/wp-includes/plugin.php(465): WP_Hook->do_action(Array)
    #3 /home/k/o/ftp_xxxxxxxxcom/wp-settings.php(394): do_action(‘plugins_loaded’)
    #4 /home/k/o/ftp_xxxxxxxxcom/wp-config.php(97): require_once(‘/home/k/o/ftp_k…’)
    #5 /home/k/o/ftp_xxxxxxxxcom/wp-load.php(37): require_once(‘/home/k/o/ftp_k…’)
    #6 /home/k/o/ftp_xxxxxxxxcom/wp-admin/admin-ajax.php(22): require_once(‘/home/k/o/ftp_k…’)
    #7 {main}
    thrown

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Class not found error updating to version 3.2.1’ is closed to new replies.