78% nice-accordion

Code Review | Nice Accordion

WordPress plugin Nice Accordion scored78%from 54 tests.

About plugin

  • Plugin page: nice-accordion
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.0.2
  • WordPress version: 6.3.1
  • First release: Jan 7, 2019
  • Latest release: Dec 7, 2019
  • Number of updates: 12
  • Update frequency: every 27.9 days
  • Top authors: nriddhi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /512 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.68MB] [CPU: ▼4.76ms] Passed 4 tests

An overview of server-side resources used by Nice Accordion
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.10 ▲0.6443.41 ▲5.80
Dashboard /wp-admin4.01 ▲0.7148.98 ▼3.07
Posts /wp-admin/edit.php4.03 ▲0.6751.59 ▼15.43
Add New Post /wp-admin/post-new.php6.73 ▲0.8584.55 ▼5.55
Media Library /wp-admin/upload.php3.93 ▲0.7039.25 ▲5.00
All Accordion /wp-admin/edit.php?post_type=nice_accordion3.9840.20
Add New /wp-admin/post-new.php?post_type=nice_accordion4.5355.09

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 129 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Nice Accordion
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲20513.73 ▼0.535.79 ▲4.2042.91 ▲3.05
Dashboard /wp-admin2,252 ▲644.98 ▲0.10107.41 ▼2.4339.46 ▼2.45
Posts /wp-admin/edit.php2,138 ▲492.27 ▲0.2540.07 ▼1.3934.74 ▼0.18
Add New Post /wp-admin/post-new.php1,563 ▲3018.84 ▼4.21627.27 ▲12.6454.71 ▲6.49
Media Library /wp-admin/upload.php1,437 ▲494.34 ▲0.1898.07 ▲2.4041.83 ▼0.44
All Accordion /wp-admin/edit.php?post_type=nice_accordion1,1042.2033.8025.45
Add New /wp-admin/post-new.php?post_type=nice_accordion3,5678.76260.2665.28

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
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 42× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/nice-accordion/library/metabox/includes/CMB2_Field.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nice-accordion/library/metabox/includes/helper-functions.php:131
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/nice-accordion/plugin.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/nice-accordion/library/metabox/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/nice-accordion/library/metabox/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/nice-accordion/library/metabox/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/nice-accordion/library/metabox/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/nice-accordion/library/metabox/includes/types/CMB2_Type_Textarea.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/nice-accordion/library/metabox/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/nice-accordion/library/metabox/includes/types/CMB2_Type_Taxonomy_Radio.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/edit.php?post_type=nice_accordion
    • > Javascript (severe) in unknown
    /wp-content/plugins/nice-accordion/assets/js/accor-cjs.js?ver=1696690459 21:47 Uncaught ReferenceError: accor_close_icon is not defined
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=nice_accordion
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=nice_accordion
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=nice_accordion
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clear is deprecated since version 5.5.0! Use wp.i18n instead.
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=nice_accordion
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clearAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.

Optimizations

Plugin configuration 90% 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
These attributes need to be fixed:
  • Screenshots: No descriptions were found for these screenshots #1, #2, #3, #4 in nice-accordion/assets to your readme.txt
You can look at the official readme.txt

nice-accordion/plugin.php 85% from 13 tests

The main PHP file in "Nice Accordion" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nice-accordion.php" instead of "plugin.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected17,186 lines of code in 101 files:
LanguageFilesBlank linesComment linesLines of code
PHP602,1305,7766,859
CSS151,2091,1544,875
SVG1002,671
JavaScript93325001,402
Sass16300251,379

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity18.13
▷ Minimum class complexity1.00
▷ Maximum class complexity182.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes68
▷ Abstract classes811.76%
▷ Concrete classes6088.24%
▷ Final classes00.00%
Methods525
▷ Static methods8716.57%
▷ Public methods43482.67%
▷ Protected methods8816.76%
▷ Private methods30.57%
Functions32
▷ Named functions3093.75%
▷ Anonymous functions26.25%
Constants9
▷ Global constants333.33%
▷ Class constants666.67%
▷ Public constants6100.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
14 PNG files occupy 0.02MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
library/metabox/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
library/metabox/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
library/metabox/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
library/metabox/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
library/metabox/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%