Coder Social home page Coder Social logo

dwnload / wp-rest-api-object-cache Goto Github PK

View Code? Open in Web Editor NEW
23.0 3.0 2.0 76 KB

Enable object caching for WordPress' REST API. Aids in increased response times of your applications endpoints.

License: MIT License

PHP 100.00%
wordpress wordpress-plugin wp-json wp-api object-cache memcached packagist php7

wp-rest-api-object-cache's People

Contributors

thefrosty avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

wp-rest-api-object-cache's Issues

Error 500 when returning a cached result

After an endpoint is correctly cached, subsequent calls may fail with an error 500.

Here is the php log:

php_1        | [29-Apr-2018 16:52:16] WARNING: [pool www] child 78 said into stderr: "NOTICE: PHP message: PHP Fatal error:  Uncaught Exception: Serialization of 'Closure' is not allowed in /var/www/html/web/wp/wp-includes/functions.php:440"
php_1        | [29-Apr-2018 16:32:19] WARNING: [pool www] child 87 said into stderr: "Stack trace:"
php_1        | [29-Apr-2018 16:32:19] WARNING: [pool www] child 87 said into stderr: "#0 /var/www/html/web/app/object-cache.php(1130): serialize(Object(WP_REST_Response))"
php_1        | [29-Apr-2018 16:32:19] WARNING: [pool www] child 87 said into stderr: "#1 /var/www/html/web/app/object-cache.php(836): WP_Object_Cache->maybe_serialize(Object(WP_REST_Response))"
php_1        | [29-Apr-2018 16:32:19] WARNING: [pool www] child 87 said into stderr: "#2 /var/www/html/web/app/object-cache.php(227): WP_Object_Cache->set('/wp-json/wp-api...', Object(WP_REST_Response), 'rest_api', 600)"
php_1        | [29-Apr-2018 16:32:19] WARNING: [pool www] child 87 said into stderr: "#3 /var/www/html/web/app/plugins/wp-rest-api-object-cache/src/RestApi/RestDispatch.php(225): wp_cache_set('/wp-json/wp-api...', Object(WP_REST_Response), 'rest_api', 600)"
php_1        | [29-Apr-2018 16:32:19] WARNING: [pool www] child 87 said into stderr: "#4 /var/www/html/web/app/plugins/wp-rest-api-object-cache/src/RestApi/RestDispatch.php(146): Dwnload\WpRestApi\RestApi\RestDispatch->getCachedResult(Object(WP_REST_Server), Object(WP_REST_Request), '/wp-json/wp-api...', 'rest_api')"
php_1        | [29-Apr-2018 16:32:19] WARNING: [pool www] child 87 said into stderr: "#5 /var/www/html/vendor/thefrosty/wp-utilities/src/Plugin/HooksTrait.php(145): Dwnload\WpRestApi\RestApi\RestDispatch->preDispatch..."
php_1        | 172.18.0.8 -  29/Apr/2018:16:32:18 +0000 "GET /index.php" 500

Also, there is a warning message:

php_1        | [29-Apr-2018 16:27:21] WARNING: [pool www] child 87 said into stderr: "NOTICE: PHP message: PHP Warning:  call_user_func_array() expects parameter 1 to be a valid callback, cannot access protected method Dwnload\WpRestApi\WpAdmin\Admin::renderPage() in /var/www/html/web/wp/wp-includes/class-wp-hook.php on line 286"
php_1        | [29-Apr-2018 16:27:21] WARNING: [pool www] child 87 said into stderr: "NOTICE: PHP message: PHP Stack trace:"
php_1        | [29-Apr-2018 16:27:21] WARNING: [pool www] child 87 said into stderr: "NOTICE: PHP message: PHP   1. {main}() /var/www/html/web/wp/wp-admin/options-general.php:0"
php_1        | [29-Apr-2018 16:27:21] WARNING: [pool www] child 87 said into stderr: "NOTICE: PHP message: PHP   2. require_once() /var/www/html/web/wp/wp-admin/options-general.php:10"
php_1        | [29-Apr-2018 16:27:21] WARNING: [pool www] child 87 said into stderr: "NOTICE: PHP message: PHP   3. do_action($tag = *uninitialized*, $arg = *uninitialized*) /var/www/html/web/wp/wp-admin/admin.php:224"
php_1        | [29-Apr-2018 16:27:21] WARNING: [pool www] child 87 said into stderr: "NOTICE: PHP message: PHP   4. WP_Hook->do_action($args = *uninitialized*) /var/www/html/web/wp/wp-includes/plugin.php:453"
php_1        | [29-Apr-2018 16:27:21] WARNING: [pool www] child 87 said into stderr: "NOTICE: PHP message: PHP   5. WP_Hook->apply_filters($value = *uninitialized*, $args = *uninitialized*) ****

Using

  • wp-rest-api-object-cache: 1.2.0
  • WordPress Version: 4.9.5
  • PHP Version: 7.2.5
  • MySQL Version: 5.5.5
  • Server Software: nginx/1.13.12

Admin Menu Bar item not visable on mobile

If the only place to flush the object cache is in the admin menu bar, and visting the site on mobile WordPress hides all menu items except the home, profile or add new post(s) items.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.