83% my-accordion

Code Review | WP Accordion

WordPress plugin WP Accordion scored83%from 54 tests.

About plugin

  • Plugin page: my-accordion
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0.1
  • WordPress version: 6.3.1
  • First release: Dec 10, 2016
  • Latest release: Feb 20, 2017
  • Number of updates: 4
  • Update frequency: every 18.3 days
  • Top authors: Sohelwpexpert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,146 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼7.80ms] Passed 4 tests

An overview of server-side resources used by WP Accordion
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.64 ▼6.00
Dashboard /wp-admin3.31 ▲0.0146.90 ▼2.00
Posts /wp-admin/edit.php3.36 ▲0.0046.09 ▼2.33
Add New Post /wp-admin/post-new.php5.89 ▲0.0182.28 ▼20.87
Media Library /wp-admin/upload.php3.23 ▲0.0036.74 ▲4.98

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

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

Browser metrics Passed 4 tests

WP Accordion: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲14813.63 ▼0.745.42 ▲3.2738.21 ▼8.72
Dashboard /wp-admin2,206 ▲185.86 ▼0.05117.93 ▲2.9241.02 ▼4.68
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0438.52 ▲3.0236.69 ▼2.76
Add New Post /wp-admin/post-new.php1,533 ▲1923.43 ▲5.92627.85 ▼62.8954.63 ▼8.14
Media Library /wp-admin/upload.php1,382 ▼64.24 ▲0.0494.59 ▼8.2340.64 ▼6.93

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% 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)
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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/my-accordion/plugin-hook.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/my-accordion/plugin-hook.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Contributors: The plugin contributors field is not present
  • Screenshots: Screenshot #1 (WP accordion in a post.) image not found
You can look at the official readme.txt

my-accordion/plugin-hook.php 92% from 13 tests

The main file in "WP Accordion" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("my-accordion.php" instead of "plugin-hook.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected170 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2152561
CSS241056
PHP1323053

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.03
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
8 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/plus_icon.png1.08KB0.19KB▼ 82.22%
images/toggle_minus@2x.png2.73KB0.08KB▼ 97.03%
images/minus_icon.png1.02KB0.15KB▼ 84.96%
images/accordion-ico.png0.64KB0.55KB▼ 13.50%
screenshot.png23.79KB11.92KB▼ 49.91%