Git Product home page Git Product logo

menu-cache's People

Contributors

bueltge avatar gmazzap avatar jrfnl avatar tfrommen 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

menu-cache's Issues

Menu key argument clarity?

Documentation is a bit unclear on how or why would you actually use MenuCache::FILTER_KEY_ARGUMENT?

On surface, it seems like working with MenuCache::FILTER_KEY is always better.

Anything I'm missing?

Proper way to install menu-cache plugin?

I created a composer.json in my wordpress directory (/var/www/mysite.com):

{
    "require": {
        "inpsyde/menu-cache": "^1.3"
    }
}

When I run composer install, the plugin is installed in /var/www/mysite.com/vendor instead of /var/www/mysite.com/wp-content/plugins.

What is the correct way to install this plugin?

Incompatible with Multisite Shared Menu

Version Information

  • PHP: 7.1
  • WordPress: 4.8

Steps to Reproduce

  1. Add both Menu Cache and Multisite Shared Menu on a Multisite installation
  2. Configure Multisite Shared Menu so that it draws the menu from some site
  3. Go to any other site, fill the cache and reload

What I Expected

A functioning sub-site

What Happened Instead

The site is switched to the menu origin's site, so content and permalinks and loads of other stuff is broken

Why does this happen

Multisite Shared Menu hooks into pre_wp_nav_menu, just like Menu Cache. It uses this hook to switch_to_blog() and restores the current blog in wp_nav_menu_items

The problem is that it never gets there if Menu Cache returned the cached HTML, so we end up with a rogue site-switch.
I'm not blaming this on Menu Cache, mind you. But since wp_nav_menu is not implemented in a way that would allow us to hook into it safely, stuff like this is bound to happen.

If Menu Cache was more aggressive about dealing with its hooke, this particular incompatibility could be avoided, however. I will post a PR for you to review

1.4.0 breaks deployment

Version Information

  • PHP: 7.1
  • WordPress: 4.8.2

Steps to Reproduce

  1. Set up a composer-based WP installation
  2. Require menu-cache 1.4.0
  3. Deploy

What I Expected

Deployment to Mittwald through Envoyer to go through without issue

What Happened Instead

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 106 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.4.0) Loading from cache
  - Installing johnpbloch/wordpress-core-installer (1.0.0) Loading from cache

 [...]

  - Installing squizlabs/php_codesniffer (3.1.1) Loading from cache
  - Installing wp-coding-standards/wpcs (0.13.1) Loading from cache
  - Installing wimg/php-compatibility (8.0.1) Loading from cache
  - Installing dealerdirect/phpcodesniffer-composer-installer (v0.4.3) Loading from cache
Plugin installation failed, rolling back
  - Removing dealerdirect/phpcodesniffer-composer-installer (v0.4.3)

                                                                                                                                           
  [Symfony\Component\Process\Exception\ProcessFailedException]                                                                             
  The command "'/files/deployments/releases/20171024101214/public/wp-content/vendor/bin/phpcs' '--config-show' 'installed_paths'" failed.  
  Exit Code: 3(Unknown error)                                                                                                              
  Working directory: /files/deployments/releases/20171024101214                                                                            
  Output:                                                                                                                                  
  ================                                                                                                                         
  Content-type: text/html; charset=UTF-8                                                                                                   
  ERROR: You must supply at least one file or directory to process.                                                                        
  Run "phpcs --help" for usage information                                                                                                 
  Error Output:                                                                                                                            
  ================                                                                                                                         
                         

It appears that during the installation, phpcs --config-set installed_paths is unset, resulting in phpcs throwing an error.

It it a requirement to use phpcs in production? Could this stuff be a dev-dependency? Maybe you should try to set the path as a post-install-cmd. Anyway, I am not sufficiently aware of the workflows surrounding the usage of the phpcs/wpcs packages within the development of menu-cache, so you probably know better.

Custom plugin with add_filter fails to activate

Version Information

  • PHP: 7.1
  • WordPress: 4.8.2

Steps to Reproduce

  1. Create custom plugin modifying menu caching period
  2. Activate custom plugin
<?php
add_filter( \Inpsyde\MenuCache\MenuCache::FILTER_EXPIRATION, function () {
  return 3600;
} );
?>

What I Expected

Custom plugin would activate and filter would modify menu caching period.

What Happened Instead

Custom plugin fails to activate:

[27-Sep-2017 05:14:53 UTC] PHP Fatal error:  Uncaught Error: Class 'Inpsyde\MenuCache\MenuCache' not found in /var/www/mysite.com/wp-content/plugins/customplugin-menu-cache/customplugin-menu-cache.php:14
Stack trace:
#0 /var/www/mysite.com/wp-admin/includes/plugin.php(560): include_once()
#1 /var/www/mysite.com/wp-admin/plugins.php(42): activate_plugin('customplugin-menu-...', 'https://www.mysite.com...', true)
#2 /var/www/mysite.com/wp-admin/network/plugins.php(13): require('/var/www/www.mysite.com...')
#3 {main}
  thrown in /var/www/mysite.com/wp-content/plugins/customplugin-menu-cache/customplugin-menu-cache.php on line 14

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.