78% accordion-slider

Code Review | Accordion Slider

WordPress plugin Accordion Slider scored78%from 54 tests.

About plugin

  • Plugin page: accordion-slider
  • Plugin version: 1.9.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Jul 27, 2021
  • Latest release: Nov 15, 2023
  • Number of updates: 20
  • Update frequency: every 42.1 days
  • Top authors: bqworks (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

2,000+ active /15,964 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.17MB] [CPU: ▼0.51ms] Passed 4 tests

A check of server-side resources used by Accordion Slider
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.47 ▼0.96
Dashboard /wp-admin3.51 ▲0.2145.73 ▲2.07
Posts /wp-admin/edit.php3.56 ▲0.2046.33 ▲0.24
Add New Post /wp-admin/post-new.php6.10 ▲0.2193.14 ▼3.38
Media Library /wp-admin/upload.php3.43 ▲0.2039.23 ▲7.95
Plugin Settings /wp-admin/admin.php?page=accordion-slider-settings3.4936.22
All Accordions /wp-admin/admin.php?page=accordion-slider3.5044.62
Add New /wp-admin/admin.php?page=accordion-slider-new3.5040.26
Documentation /wp-admin/admin.php?page=accordion-slider-documentation3.4335.85
Add-ons /wp-admin/admin.php?page=accordion-slider-add-ons3.50226.99

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 126 new files
Database: 3 new tables, 8 new options
New tables
wp_accordionslider_layers
wp_accordionslider_accordions
wp_accordionslider_panels
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_bqw-accordion-slider-widget
db_upgraded
accordion_slider_version

Browser metrics Passed 4 tests

An overview of browser requirements for Accordion Slider
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲6614.22 ▼0.511.69 ▼0.0540.52 ▼2.80
Dashboard /wp-admin2,230 ▲525.56 ▼0.1790.70 ▼11.3274.65 ▲34.43
Posts /wp-admin/edit.php2,138 ▲351.95 ▼0.0138.12 ▼1.7838.79 ▼1.71
Add New Post /wp-admin/post-new.php6,398 ▲4,87227.69 ▲4.80807.94 ▲165.9135.08 ▼14.30
Media Library /wp-admin/upload.php1,441 ▲384.19 ▲0.0296.22 ▼6.7170.96 ▲27.82
Plugin Settings /wp-admin/admin.php?page=accordion-slider-settings1,2493.6859.0771.14
All Accordions /wp-admin/admin.php?page=accordion-slider1,1743.6046.9764.13
Add New /wp-admin/admin.php?page=accordion-slider-new2,4066.10100.8772.30
Documentation /wp-admin/admin.php?page=accordion-slider-documentation3,4353.7346.89119.84
Add-ons /wp-admin/admin.php?page=accordion-slider-add-ons1,1223.7049.5596.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_bqw-accordion-slider-widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
The following issues need your attention
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/accordion-slider/admin/views/panel/panel.php
    • > /wp-content/plugins/accordion-slider/admin/views/add-ons/add-on-more-details.php
  • 44× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: panel_type in wp-content/plugins/accordion-slider/admin/views/panel/panel.php on line 16
    • > PHP Notice
      Undefined variable: panel_type in wp-content/plugins/accordion-slider/admin/views/panel/panel.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/accordion-slider/admin/views/panel-editors/html-editor.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'BQW_AS_Layer_Renderer' not found in wp-content/plugins/accordion-slider/public/class-heading-layer-renderer.php:7
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/accordion-slider/admin/views/accordion-settings/default-panel.php on line 4
    • > PHP Notice
      Undefined variable: panel_type in wp-content/plugins/accordion-slider/admin/views/panel/panel.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/accordion-slider/admin/views/panel-settings/custom-panel-settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/accordion-slider/admin/views/panel-settings/gallery-panel-settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/accordion-slider/admin/views/panel-editors/background-image-editor.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/accordion-slider/admin/views/accordion/accordion.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: image accordion, vertical accordion, accordion lightbox, responsive slider, responsive accordion...

accordion-slider/accordion-slider.php Passed 13 tests

The main PHP script in "Accordion Slider" version 1.9.8 is automatically included on every request by WordPress
46 characters long description:
Responsive and touch-enabled accordion slider.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected48,329 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
JSON40028,338
JavaScript162,9532,6629,960
PHP531,0522,1885,647
CSS11516792,655
HTML116501,628
SVG10040
Markdown113035
Sass14026

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity23.40
▷ Minimum class complexity2.00
▷ Maximum class complexity143.00
Average method complexity3.72
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes25
▷ Abstract classes00.00%
▷ Concrete classes25100.00%
▷ Final classes00.00%
Methods206
▷ Static methods2914.08%
▷ Public methods13866.99%
▷ Protected methods5526.70%
▷ Private methods136.31%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
21 PNG files occupy 0.50MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
documentation/assets/images/export-accordion.png50.16KB17.13KB▼ 65.85%
documentation/assets/images/panel-buttons.png3.84KB2.34KB▼ 39.08%
documentation/assets/images/general-settings.png50.57KB18.82KB▼ 62.79%
documentation/assets/images/background-editor.png26.89KB11.24KB▼ 58.20%
documentation/assets/images/layers-editor.png17.73KB7.57KB▼ 57.29%