52% stonehenge-em-slider

Code Review | Events Manager - Events / Locations Slider

WordPress plugin Events Manager - Events / Locations Slider scored52%from 54 tests.

About plugin

  • Plugin page: stonehenge-em-slider
  • Plugin version: 1.8.7
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.9
  • WordPress version: 6.3.1
  • First release: Jan 22, 2019
  • Latest release: Mar 10, 2022
  • Number of updates: 51
  • Update frequency: every 22.6 days
  • Top authors: DuisterDenHaag (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /4,461 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.71MB] [CPU: ▼0.00ms] 75% from 4 tests

A check of server-side resources used by Events Manager - Events / Locations Slider
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 26,237.82ms on /wp-admin/admin.php?page=stonehenge-plugins)
PageMemory (MB)CPU Time (ms)
Home /4.20 ▲0.7443.48 ▲4.15
Dashboard /wp-admin4.02 ▲0.6855.03 ▼5.47
Posts /wp-admin/edit.php4.08 ▲0.7253.74 ▲10.03
Add New Post /wp-admin/post-new.php6.63 ▲0.7488.72 ▼8.44
Media Library /wp-admin/upload.php3.95 ▲0.7244.58 ▲9.74
 More... /wp-admin/admin.php?page=stonehenge-plugins3.9526,237.82
EM - Events Slider /wp-admin/admin.php?page=stonehenge_em_slider3.9242.51
Free Support /wp-admin/admin.php?page=stonehenge_forums3.8938.51

Server storage [IO: ▲3.07MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 1,127 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Events Manager - Events / Locations Slider
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲4714.68 ▲0.401.57 ▼0.2538.48 ▼5.25
Dashboard /wp-admin2,227 ▲475.51 ▼0.0996.51 ▲6.8042.71 ▲4.40
Posts /wp-admin/edit.php2,129 ▲292.01 ▲0.0136.70 ▼0.6131.43 ▼3.33
Add New Post /wp-admin/post-new.php1,549 ▲2123.06 ▼0.06604.92 ▲6.1172.67 ▲10.30
Media Library /wp-admin/upload.php1,429 ▲264.28 ▲0.1097.76 ▼5.8643.31 ▼0.05
 More... /wp-admin/admin.php?page=stonehenge-plugins1,0522.1929.7651.29
EM - Events Slider /wp-admin/admin.php?page=stonehenge_em_slider8372.1829.4836.82
Free Support /wp-admin/admin.php?page=stonehenge_forums9342.2831.5354.99

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/stonehenge-em-slider/uninstall.php+13
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=stonehenge_forums
    • > Notice in wp-content/plugins/stonehenge-em-slider/stonehenge/class-forum.php+55
    Undefined offset: 1

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/symfony/translation/Resources/bin/translation-status.php
    • > /wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/mustache/mustache/bin/build_bootstrap.php
  • 290× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Thunder\\Shortcode\\HandlerContainer\\HandlerContainerInterface' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/thunderer/shortcode/src/HandlerContainer/ImmutableHandlerContainer.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\ode\\AbstractNode' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/symfony/css-selector/Node/SelectorNode.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Puc_v4p6_InstalledPackage' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/server/Puc/v4p6/Plugin/Package.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Catalogue\\OperationInterface' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/symfony/translation/Catalogue/AbstractOperation.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Yaml\\Exception\\RuntimeException' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/symfony/yaml/Exception/DumpException.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/mustache/mustache/test/Mustache/Test/CompilerTest.php:15
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Config\\Resource\\SelfCheckingResourceInterface' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/symfony/config/Resource/ComposerResource.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Mustache_Logger' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/mustache/mustache/src/Mustache/Logger/AbstractLogger.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\FileLoader' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/symfony/translation/Loader/JsonFileLoader.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\CssSelector\\XPath\\Extension\\AbstractExtension' not found in wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/symfony/css-selector/XPath/Extension/FunctionExtension.php:31

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: slider, slide, carousel, events manager, fade

stonehenge-em-slider/stonehenge-em-slider.php Passed 13 tests

The main PHP file in "Events Manager - Events / Locations Slider" ver. 1.8.7 adds more information about the plugin and also serves as the entry point for this plugin
129 characters long description:
Create a dynamic Slider (carousel or fade) for Events and Locations with EM arguments you already know, using a simple shortcode.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Almost there! Just fix the following issues
  • For security reasons, never distribute binary or executable files with your plugin
    • .ms - Maxwell Script in Maxwell Render
      • wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/mustache/mustache/test/fixtures/templates/alpha.ms
      • wp-content/plugins/stonehenge-em-slider/stonehenge/vendor/mustache/mustache/test/fixtures/templates/beta.ms
65,757 lines of code in 1,017 files:
LanguageFilesBlank linesComment linesLines of code
PHP5238,48515,50342,499
YAML2909756017,942
JavaScript828761,0845,675
XSD392482,803
Markdown3268301,831
JSON19001,629
CSS959641,380
LESS211571,080
PO File14124139565
Mustache3610145
Perl114898
XML45097
make12011
Dockerfile1102

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 159)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity10.07
▷ Minimum class complexity1.00
▷ Maximum class complexity309.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity159.00
Code structure
Namespaces79
Interfaces58
Traits1
Classes457
▷ Abstract classes245.25%
▷ Concrete classes43394.75%
▷ Final classes8619.86%
Methods2,616
▷ Static methods2198.37%
▷ Public methods2,06678.98%
▷ Protected methods28010.70%
▷ Private methods27010.32%
Functions230
▷ Named functions8637.39%
▷ Anonymous functions14462.61%
Constants137
▷ Global constants53.65%
▷ Class constants13296.35%
▷ Public constants12594.70%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
15 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
stonehenge/assets/images/ui-icons_777777_256x240.png6.85KB4.18KB▼ 38.94%
stonehenge/assets/images/ui-icons_444444_256x240.png6.84KB4.18KB▼ 38.90%
stonehenge/assets/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
stonehenge/assets/images/ui-icons_004276_256x240.png4.44KB4.17KB▼ 6.02%
stonehenge/assets/images/ui-icons_ffffff_256x240.png6.17KB4.18KB▼ 32.17%