88% accordions-wp

Code Review | Accordion

WordPress plugin Accordion scored 88% from 54 tests.

About plugin

  • Plugin page: accordions-wp
  • Plugin version: 2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.5.1
  • WordPress version: 5.9.2
  • First release: Feb 12, 2015
  • Latest release: Oct 25, 2020
  • Number of updates: 72
  • Update frequency: every 28.9 days
  • Top authors: themepoints (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active / 40,679 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.42MB] [CPU: ▼302.82ms] Passed 4 tests

Analyzing server-side resources used by Accordion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.97 ▲0.4667.46 ▲13.07
Dashboard /wp-admin3.83 ▲0.4364.33 ▼39.21
Posts /wp-admin/edit.php4.06 ▲0.4145.78 ▼2.79
Add New Post /wp-admin/post-new.php7.37 ▲0.40101.46 ▼1,169.08
Media Library /wp-admin/upload.php3.78 ▲0.4931.65 ▼0.20
Add New Accordion /wp-admin/post-new.php?post_type=accordion_tp4.0656.88
Accordion Pro Features /wp-admin/options-general.php?page=accordion-free-features3.7531.78
Help & Support /wp-admin/edit.php?post_type=accordion_tp&page=support3.7643.36
All Accordions /wp-admin/edit.php?post_type=accordion_tp3.8330.83

Server storage [IO: ▲0.45MB] [DB: ▲0.00MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 71 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Accordion
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,971 ▲21716.82 ▲1.209.44 ▲3.542.20 ▼0.76
Dashboard /wp-admin2,950 ▲896.82 ▲0.55119.45 ▼20.43170.34 ▲4.33
Posts /wp-admin/edit.php2,720 ▲293.04 ▼0.2068.42 ▼27.51210.56 ▲61.46
Add New Post /wp-admin/post-new.php1,706 ▲6816.41 ▼6.02406.17 ▼59.26198.77 ▲40.80
Media Library /wp-admin/upload.php1,756 ▲585.95 ▲0.41160.23 ▲23.39209.69 ▲26.58
Add New Accordion /wp-admin/post-new.php?post_type=accordion_tp3,9818.03181.44360.98
Accordion Pro Features /wp-admin/options-general.php?page=accordion-free-features1,4472.8657.09178.71
Help & Support /wp-admin/edit.php?post_type=accordion_tp&page=support1,1132.9858.02128.35
All Accordions /wp-admin/edit.php?post_type=accordion_tp1,4453.5399.75124.80

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

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)
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/accordions-wp/custom-accordion-admin.php
    • > /wp-content/plugins/accordions-wp/custom-accordion-wp.php
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/accordions-wp/metabox/classes.fields.php:581
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/accordions-wp/metabox/example-functions.php:104
    • > PHP Warning
      Use of undefined constant WP_CONTENT_URL - assumed 'WP_CONTENT_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/accordions-wp/metabox/custom-meta-boxes.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/accordions-wp/metabox/classes.fields.php:581
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/accordions-wp/metabox/custom-meta-boxes.php on line 46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 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
6 plugin tags: responsive accordions, responsive accordions plugin, jquery accordions, accordion, accordions shortcode...

accordions-wp/custom-accordion-wp.php 85% from 13 tests

The main PHP script in "Accordion" version 2.6 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("accordions-wp.php" instead of "custom-accordion-wp.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 233 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin7,552 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
CSS173251582,999
JavaScript117114532,757
PHP97873701,764
PO File181032

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes14.55%
▷ Concrete classes2195.45%
▷ Final classes00.00%
Methods92
▷ Static methods22.17%
▷ Public methods8895.65%
▷ Protected methods11.09%
▷ Private methods33.26%
Functions28
▷ Named functions28100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
26 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
metabox/css/vendor/jquery-ui/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
css/minus_icon.png1.02KB0.15KB▼ 84.96%
css/plus_icon_shadow.png1.00KB0.13KB▼ 87.35%
metabox/js/select2/select2.png0.60KB0.99KB0.00%
metabox/css/vendor/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png0.32KB0.15KB▼ 54.82%