83% accordion-slider-gallery

Code Review | Accordion Slider Gallery

WordPress plugin Accordion Slider Gallery scored 83% from 54 tests.

About plugin

  • Plugin page: accordion-slider-...
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-5.9
  • WordPress version: 5.8.1
  • First release: Jul 11, 2020
  • Latest release: Feb 23, 2022
  • Number of updates: 18
  • Update frequency: every 33.0 days
  • Top authors: wpdiscover (100%)

Code review

54 tests

User reviews

1 review

Install metrics

3,000+ active / 19,170 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼152.43ms] Passed 4 tests

Analyzing server-side resources used by Accordion Slider Gallery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0524.12 ▲0.87
Dashboard /wp-admin3.10 ▲0.0430.59 ▼8.76
Posts /wp-admin/edit.php3.19 ▲0.0829.12 ▼1.04
Add New Post /wp-admin/post-new.php5.55 ▲0.1168.90 ▼600.77
Media Library /wp-admin/upload.php3.05 ▲0.0423.45 ▲1.64
Galleries /wp-admin/edit.php?post_type=accordion_slider3.0923.93
Add New /wp-admin/post-new.php?post_type=accordion_slider3.1836.38

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 108 new files
Database: no new tables, 4 new options
New WordPress options
rpg-slider-images-default
accordion-slider-type
accordion-slider-installDate
accordion-slider-v

Browser metrics Passed 4 tests

Checking browser requirements for Accordion Slider Gallery
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,824 ▲22316.16 ▲0.118.17 ▲3.0777.42 ▲1.36
Dashboard /wp-admin2,975 ▲766.04 ▼0.10117.36 ▼17.48171.77 ▼4.33
Posts /wp-admin/edit.php2,788 ▲643.24 ▼0.0064.06 ▼0.92137.42 ▼4.57
Add New Post /wp-admin/post-new.php3,739 ▲419.05 ▲0.43457.20 ▼3.13160.20 ▼2.64
Media Library /wp-admin/upload.php1,869 ▲1175.70 ▲0.25151.37 ▲8.66179.88 ▼9.66
Galleries /wp-admin/edit.php?post_type=accordion_slider1,4683.0861.30115.84
Add New /wp-admin/post-new.php?post_type=accordion_slider4,1488.18182.59259.99

Uninstaller [IO: ▲3.04MB] [DB: ▲0.01MB] 75% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 4 options
    • rpg-slider-images-default
    • accordion-slider-v
    • accordion-slider-installDate
    • accordion-slider-type

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 15× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ACCORDION_SLIDER_IMAGES - assumed 'ACCORDION_SLIDER_IMAGES' (this will throw an Error in a future version of PHP) in wp-content/plugins/accordion-slider-gallery/default_image.php on line 3
    • > PHP Warning
      Use of undefined constant ACCORDION_SLIDER_IMAGES - assumed 'ACCORDION_SLIDER_IMAGES' (this will throw an Error in a future version of PHP) in wp-content/plugins/accordion-slider-gallery/default_image.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/accordion-slider-gallery/includes/public/templates/design/accordion-slider/accordion-slider.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/accordion-slider-gallery/accordion-slider.php:18
    • > PHP Warning
      Use of undefined constant ACCORDION_SLIDER_IMAGES - assumed 'ACCORDION_SLIDER_IMAGES' (this will throw an Error in a future version of PHP) in wp-content/plugins/accordion-slider-gallery/default_image.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/accordion-slider-gallery/default_image.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/accordion-slider-gallery/includes/admin/accordion-slider-js-templates.php:3
    • > PHP Warning
      require(ACCORDION_SLIDER_LIBRARIESclass-gamajo-template-loader.php): failed to open stream: No such file or directory in wp-content/plugins/accordion-slider-gallery/includes/libraries/class-accordion-slider-template-loader.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/accordion-slider-gallery/includes/admin/class-accordion-slider-admin.php:15
    • > PHP Warning
      include(): Failed opening 'ABSPATHwp-includes/pluggable.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/accordion-slider-gallery/default_image.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes: You can look at the official readme.txt

accordion-slider-gallery/accordion-slider.php 85% from 13 tests

Analyzing the main PHP file in "Accordion Slider Gallery" version 2.2
You should first fix the following items:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("accordion-slider-gallery.php" instead of "accordion-slider.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin18,546 lines of code in 77 files:
LanguageFilesBlank linesComment linesLines of code
SVG50135,563
CSS151,9551355,315
JavaScript115262552,253
Sass1643341,903
LESS1641511,870
PHP144824761,642

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity19.10
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity4.29
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods55
▷ Static methods814.55%
▷ Public methods4276.36%
▷ Protected methods35.45%
▷ Private methods1018.18%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/close.png0.27KB0.29KB0.00%
assets/images/next.png1.32KB1.58KB0.00%
assets/images/sprites.png0.41KB0.44KB0.00%
assets/images/prev.png1.33KB1.59KB0.00%