WordPress.org

Forums

Page Security & Membership
[resolved] [Plugin: Page Security by Contexture] Unable to call CTXPS_App::localize_init() (10 posts)

  1. Angel
    Member
    Posted 4 years ago #

    Hi, I have de last version of the plugin 1.4.1 instaled.
    In localhost there are no problems, all perfect.

    But when I upload it to the server i got a problem.

    When I activate the plugin I got:

    Warning: call_user_func_array() [function.call-user-func-array]: Unable to call CTXPS_App::localize_init() in ***/wp-includes/plugin.php on line 395

    Warning: call_user_func_array() [function.call-user-func-array]: Unable to call CTXPS_App::admin_screens_init() in ***/wp-includes/plugin.php on line 395

    Warning: call_user_func_array() [function.call-user-func-array]: Unable to call CTXPS_App::admin_init() in ***/wp-includes/plugin.php on line 395

    Warning: call_user_func_array() [function.call-user-func-array]: Unable to call CTXPS_App::help_init() in ***/wp-includes/plugin.php on line 395

    And in the frontend similar errors.

    Please help, I don't understand why works perfectly in localhost but don't at the server.

    I checked that is not a problem of incompability with other plugin or width the template.

  2. Matt van Andel
    Member
    Plugin Author

    Posted 4 years ago #

    It sounds like a bad upload. Here's what you do:

    1. Deactivate PSC in your admin (do NOT delete via WordPress admin if need to preserve your security settings)
    2. Via FTP or SSH, manually delete the /wp-content/plugins/contexture-page-security/ directory
    3. Re-download 1.4.1 via WordPress's Plugins > Add Plugin page.
    4. Re-activate Page Security

    This should set everything right.

  3. Geoff
    Member
    Posted 4 years ago #

    I' getting a similar error and deleting and reuploading didn't work.

    Fatal error: Call to undefined method CTXPS_Tables::prepare() in /home5/wp-content/plugins/contexture-page-security/core/model_queries.php on line 892

  4. Geoff
    Member
    Posted 4 years ago #

    I sent back to 1.4.0 and all is well again.

    I did notice on 1.4.0 that each person needed to be a member of a group, not just a registered user and each page needed a group assignment, not just registered user to be protected. This is why I upgraded to 1.4.1 thinking it fixed that.

  5. Angel
    Member
    Posted 4 years ago #

    Thanks Veraxus but I tried to delete it and upload it again and it didn't work.

    I have the wordpress version 3.0.4, maybe the problem is related to that?

    My theme is the free template cp-minimal, and I have a lot of plugins instaled like formidable forms, login width ajax, mee news.
    But in localhost works perfectly.

    I dont know what to do.

  6. Matt van Andel
    Member
    Plugin Author

    Posted 4 years ago #

    Hey Geoff,

    We nailed the CTXPS_Tables::prepare() bug today. Updating to 1.4.2 should finally get everything working the way it's supposed to.

    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
    Churrimurris,

    Can you tell me what version of PHP your server is running, and which hosting service?

    Technically, PSC should throw an error and refuse to activate if you're running a version of PHP prior to 5.2.x, but from the looks of it, your server is choking on the 'class::method' callback (and you don't seem to have gotten the PHP version warning).

    Also, if you shoot me an email (opensource@contextureintl.com), I'd like to send you a modified version of PSC to try out on your production server.

  7. Geoff
    Member
    Posted 4 years ago #

    PHP Version 5.2.16
    I'm on Hostmonster.

  8. Angel
    Member
    Posted 4 years ago #

    I appreciate that you try to help me.

    My server is running php 5.1.6 and it's from arsys http://www.arsys.es

    I'm looking for a solution, if I get it I will tell you.

    I sent you an email too.

    Thanks again.

  9. Matt van Andel
    Member
    Plugin Author

    Posted 4 years ago #

    To finish off this thread, several points:

    Page Security requires PHP 5.2.3 to work. There's a version check that should notify you if you current version is too low. But let me give you some technical details (other plugin developers might find this handy):

    Because I need to hook directly to static methods in custom classes, my callbacks look like this:
    add_action('admin_menu', 'CTXPS_App::admin_screens_init');

    This style of callback requires PHP 5.2.3 or higher. To support earlier versions of PHP, this callback would technically be written this way:
    add_action('admin_menu', array('CTXPS_App','admin_screens_init'));

    HOWEVER - WordPress contains a very unfortunate bug that somehow makes this style of callback invalid. In my own probing, it seems that when an array-formatted callback finally gets to call_user_func_array() in the WordPress core, an additional item has been added to the array. So instead of being given the valid array-formatted callback that I've defined, the array now look like this:

    array('CTXPS_App','admin_screens_init',1)

    This is now an invalid callback. Somehow, WordPress has appended a value to the array. This means that there is only one way to use WordPress hooks with methods... using string-formatted callbacks (which, as stated earlier, requires PHP 5.2.3 or higher).

    This is very unfortunate, but it's a bug in the WordPress core that isn't easily fixed. I have some workaround ideas that can be included in plugins that need this, and I'll post them to the codex if one of them works.

    Churrimurris:
    At the moment, it seems the only solution is to see if your hosting service can update PHP. I'll look into those workarounds and let you know if I come up with a solution.

  10. Angel
    Member
    Posted 4 years ago #

    Ok, I will ask to my hosting service for update PHP.

    Thanks for all, you're plugin is great anyway.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Page Security & Membership
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic