67% wp-accordions

Code Review | WP Accordions

WordPress plugin WP Accordions scored67%from 54 tests.

About plugin

  • Plugin page: wp-accordions
  • Plugin version: 1.2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.2.2
  • WordPress version: 6.3.1
  • First release: Oct 24, 2018
  • Latest release: Sep 26, 2019
  • Number of updates: 19
  • Update frequency: every 20.7 days
  • Top authors: creativehassan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /772 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼9.43ms] Passed 4 tests

Server-side resources used by WP Accordions
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1146.84 ▼5.59
Dashboard /wp-admin3.40 ▲0.0550.61 ▼11.24
Posts /wp-admin/edit.php3.43 ▲0.0751.17 ▼4.37
Add New Post /wp-admin/post-new.php5.98 ▲0.0989.90 ▼16.53
Media Library /wp-admin/upload.php3.32 ▲0.0943.24 ▲6.55
All Accordions /wp-admin/edit.php?post_type=wp-accordions3.3737.51
Add New /wp-admin/post-new.php?post_type=wp-accordions3.4148.76

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 28 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
recovery_mode_email_last_sent
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for WP Accordions
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,062 ▲30114.35 ▲0.002.92 ▲1.2751.08 ▲9.25
Dashboard /wp-admin2,344 ▲1645.85 ▲0.2291.98 ▲4.4840.38 ▼0.41
Posts /wp-admin/edit.php2,254 ▲1512.34 ▲0.3140.88 ▼2.8336.10 ▲1.13
Add New Post /wp-admin/post-new.php1,667 ▲14123.45 ▲0.24698.48 ▲59.3139.26 ▼13.65
Media Library /wp-admin/upload.php1,553 ▲1534.44 ▲0.20114.77 ▲3.6047.68 ▲1.90
All Accordions /wp-admin/edit.php?post_type=wp-accordions1,2152.3134.4729.48
Add New /wp-admin/post-new.php?post_type=wp-accordions1,3701.539.5455.18

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=wp-accordions
    • > Error in wp-content/plugins/wp-accordions/includes/options-functions.php+85
    Uncaught ArgumentCountError: Too few arguments to function wp_accordion_create_form(), 4 passed in wp-content/plugins/wp-accordions/admin/parts/accordion-metabox.php on line 58 and exactly 5 expected in wp-content/plugins/wp-accordions/includes/options-functions.php:85
    Stack trace:
    #0 wp-content/plugins/wp-accordions/admin/parts/accordion-metabox.php(58): wp_accordion_create_form()
    #1 wp-content/plugins/wp-accordions/wp-accordions.php(170): include_once('/var/www/wordpr...')
    #2 wp-admin/includes/template.php(1443): wp_accordions->wpt_wp_accordions_location()
    #3 wp-admin/edit-form-advanced.php(688): do_meta_boxes()
    #4 wp-admin/post-new.php(75): require('/var/www/wordpr...')
    #5 {main}
    thrown

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× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wp-accordions/includes/options.php
    • > /wp-content/plugins/wp-accordions/includes/options-functions.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _x() in wp-content/plugins/wp-accordions/admin/accordion-post-type.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-accordions/admin/parts/accordion-placeholder.php:74
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/wp-accordions/templates/accordion-simple.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/wp-accordions/admin/parts/accordion-metabox-type.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-accordions/admin/parts/accordion-placeholder.php:74
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/wp-accordions/admin/parts/accordion-metabox.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/wp-accordions/templates/accordion-slide.php:3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-accordions/admin/parts/accordion-view.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/wp-accordions/admin/parts/accordion-metabox-setting.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/wp-accordions/templates/accordion-animated.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/post-new.php?post_type=wp-accordions
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).wpColorPicker is not a function" "TypeError: $(...).wpColorPicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-accordions/assets/js/wp-accordions-admin.js?ver=6.3.1:6:21)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=wp-accordions
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).wpColorPicker is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

wp-accordions/wp-accordions.php Passed 13 tests

The main PHP script in "WP Accordions" version 1.2.0 is automatically included on every request by WordPress
92 characters long description:
WordPress Simple Accordions to show with short-codes It is based on CSS and Java-script Both

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
There were no executable files found in this plugin1,781 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP167569819
CSS5434775
JavaScript4347187

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/accordion.png1.17KB0.66KB▼ 43.60%