Opache is caching in PHP, it takes your PHP code and compile it, so your site runs faster. For some large hosting companies they enable a flag called save_comments.
Quote from docs.
If disabled, all documentation comments will be discarded from the opcode cache to reduce the size of the optimised code. Disabling this configuration directive may break applications and frameworks that rely on comment parsing for annotations, including Doctrine, Zend Framework 2 and PHPUnit.
The unsplash plugin ( and the wp-foo-bar template ) use annotations to hook in filters and actions. See this example.
Bug Description
Opache is caching in PHP, it takes your PHP code and compile it, so your site runs faster. For some large hosting companies they enable a flag called save_comments.
Quote from docs.
The unsplash plugin ( and the wp-foo-bar template ) use annotations to hook in filters and actions. See this example.
https://github.com/xwp/unsplash-wp/blob/dee982ac2ad671b89e443b6eae5e2443b0b321c2/php/class-hotlink.php#L407-L419
As comments are required for these filters / actions to hooked, when opache removes them, the plugin does not function.
Original bug reports - Settings won’t load on install
Expected Behaviour
Plugin should work if opcache.save_comments is disabled, as many hosting companies may disable
save_comments
Steps to reproduce
Set opache.save_comments = false.
Acceptance criteria
Implementation brief
Instead of using annotations to hook in filters and actions like this https://github.com/xwp/unsplash-wp/blob/dee982ac2ad671b89e443b6eae5e2443b0b321c2/php/class-hotlink.php#L414
simply use php
QA testing instructions
Demo
Changelog entry