• Resolved unCommons

    (@uncommons)


    Hello,

    I’m trying to integrate “Redis Object Cache” in my plugin.

    I copied entire redis-cache folder in my plugin and I required the main file (using the after_setup_theme hook).

    All seems to work well but the Redis connection is not working.

    Here the report:

    Status: Not Connected
    Client: Predis
    Drop-in: Valid
    Ping: PONG
    Redis Extension: Not Found
    Predis Client: 1.1.1
    PHP Version: 7.3.16
    Redis Version: Unknown
    Multisite: No
    Global Prefix: "wpgh_"
    Blog Prefix: "wpgh_"
    Global Groups: [
        "blog-details",
        "blog-id-cache",
        "blog-lookup",
        "global-posts",
        "networks",
        "rss",
        "sites",
        "site-details",
        "site-lookup",
        "site-options",
        "site-transient",
        "users",
        "useremail",
        "userlogins",
        "usermeta",
        "user_meta",
        "userslugs"
    ]
    Ignored Groups: [
        "counts",
        "plugins",
        "blog-details",
        "blog-id-cache",
        "blog-lookup",
        "global-posts",
        "networks",
        "rss",
        "sites",
        "site-details",
        "site-lookup",
        "site-options",
        "site-transient",
        "users",
        "useremail",
        "userlogins",
        "usermeta",
        "user_meta",
        "userslugs",
        "blog_meta",
        "themes"
    ]
    Unflushable Groups: []
    Dropins: 
     - Query Monitor Database Class v by 
     - Redis Object Cache Drop-In v1.5.7 by Till Krüss
    Plugins: 
     - Query Monitor v3.5.2 by John Blackbourn (Active)
     - My Plugin (Active)

    As you can see Redis is not found at all.

    If I install the plugin with thw common way it work perfectly (deeply reducing the time of my queries).

    Have you some advice to integrate your plugin into another plugin?

    Thanks a lot!

    Best Regards

    • This topic was modified 4 years, 11 months ago by unCommons.
Viewing 3 replies - 1 through 3 (of 3 total)
  • I would not recommend doing this if you are going to distribute your plugin to the public – it leaves users at your plugins mercy to receive updates, and also might conflict if they already have ROC installed. It is also non-standard WordPress architecture. If it really is necessary for your plugin, it would be better to display an activation notice that ROC is either recommend or required (using your own code, or something like TGMPA or Requirements, etc).

    That said, I’m betting that wp-content/object-cache.php isn’t being created/copied using your method, since the activation hook isn’t triggered. You could modify your code to copy it over itself on activation/remove on deactivation (the file is located in the plugin’s includes directory), but again, this is unorthodox and not recommended.

    Daniel

    Thread Starter unCommons

    (@uncommons)

    Hello Daniel,

    thank you for the quick answer.

    I add some detail about my project:

    1. the plugin will be not public or distributed (it’s for my agency)

    2. I’m using the filesystem’s copy function to copy the object-cache.php file on the right position

    3. My goal is to allow my team to have object cache simply installing our agency plugin (without TGMPA or other actions)

    4. For now I solved installing PHP Redis module on my server and integrating “WP Redis” plugin

    In the future if I can solve the connection issue I will turn back to use Redis Object Cache because it seems to be better and more advanced than WP Redis.

    Thank you very much for your time,
    Kind Regards

    • This reply was modified 4 years, 11 months ago by unCommons.
    Plugin Author Till Krüss

    (@tillkruess)

    @uncommons: Daniel is right, don’t include this plugin’s source code along yours, you’ll have to keep updating it every month or so and worry about potential security issues.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Integrate redis-cache in Plugin’ is closed to new replies.