83% xg-accordion

Code Review | XG Accordion

WordPress plugin XG Accordion scored83%from 54 tests.

About plugin

  • Plugin page: xg-accordion
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9.8
  • WordPress version: 6.3.1
  • First release: Oct 25, 2018
  • Latest release: Oct 25, 2018
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: xgenious (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /9,980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.08MB] [CPU: ▼10.36ms] Passed 4 tests

Analyzing server-side resources used by XG Accordion
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1035.07 ▼3.45
Dashboard /wp-admin3.39 ▲0.0545.08 ▼16.03
Posts /wp-admin/edit.php3.44 ▲0.0946.91 ▲1.61
Add New Post /wp-admin/post-new.php5.99 ▲0.1179.82 ▼23.56
Media Library /wp-admin/upload.php3.31 ▲0.0835.96 ▲3.42
New Accordion /wp-admin/post-new.php?post_type=xga_accordion3.4444.68
All Accordion Shortcode /wp-admin/edit.php?post_type=xga-shortcode3.3635.16
Help & Support /wp-admin/admin.php?page=xga-help3.3229.63
Accordion Category /wp-admin/edit-tags.php?taxonomy=xga_accorr_cat&post_type=xga_accordion3.3032.14
All Accordion /wp-admin/edit.php?post_type=xga_accordion3.3634.31

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 50 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for XG Accordion
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,899 ▲16413.80 ▼0.591.58 ▼0.1342.88 ▼4.73
Dashboard /wp-admin2,278 ▲905.44 ▼0.46119.84 ▲9.2383.95 ▲39.31
Posts /wp-admin/edit.php2,157 ▲682.57 ▲0.5439.60 ▼1.0228.63 ▼2.95
Add New Post /wp-admin/post-new.php1,593 ▲5123.32 ▲5.10667.47 ▲6.5436.60 ▼19.24
Media Library /wp-admin/upload.php1,473 ▲854.66 ▲0.4191.85 ▼5.9978.77 ▲33.43
New Accordion /wp-admin/post-new.php?post_type=xga_accordion2,3838.18218.52151.35
All Accordion Shortcode /wp-admin/edit.php?post_type=xga-shortcode1,1312.5138.9928.44
Help & Support /wp-admin/admin.php?page=xga-help9632.2931.6542.48
Accordion Category /wp-admin/edit-tags.php?taxonomy=xga_accorr_cat&post_type=xga_accordion1,3572.3230.0429.04
All Accordion /wp-admin/edit.php?post_type=xga_accordion1,1512.7337.6744.40

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'XGA_ACCORDION_PATH/admin/lib/xgm/xg_metabox_framework.php' (include_path='.:/usr/share/php') in wp-content/plugins/xg-accordion/admin/xg_accordion_metabox.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'XGA_ACCORDION_PATH/admin/lib/xgm/xgp_options_framework.php' (include_path='.:/usr/share/php') in wp-content/plugins/xg-accordion/admin/xg_accrodion_menu_page.php on line 8
    • > PHP Warning
      Use of undefined constant XGA_ACCORDION_PATH - assumed 'XGA_ACCORDION_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/xg-accordion/admin/xg_accordion_metabox.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/xg-accordion/admin/lib/xgm/xg_metabox_framework.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/xg-accordion/admin/partials/xga-help-display.php:5
    • > PHP Warning
      require_once(XGA_ACCORDION_PATH/public/shortcode/class-xga-accordion-shortcode.php): failed to open stream: No such file or directory in wp-content/plugins/xg-accordion/public/xga-helpers.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'XGA_ACCORDION_PATH/public/shortcode/class-xga-accordion-shortcode.php' (include_path='.:/usr/share/php') in wp-content/plugins/xg-accordion/public/xga-helpers.php on line 3
    • > PHP Warning
      require_once(XGA_ACCORDION_PATH/admin/lib/xgm/xgp_options_framework.php): failed to open stream: No such file or directory in wp-content/plugins/xg-accordion/admin/xg_accrodion_menu_page.php on line 8
    • > PHP Warning
      Use of undefined constant XGA_ACCORDION_PATH - assumed 'XGA_ACCORDION_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/xg-accordion/admin/xg_accrodion_menu_page.php on line 8
    • > PHP Warning
      Use of undefined constant XGA_ACCORDION_PATH - assumed 'XGA_ACCORDION_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/xg-accordion/public/xga-helpers.php on line 3

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 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5 in xg-accordion/assets to your readme.txt
  • Donate link: Invalid URI ("")
The official readme.txt is a good inspiration

xg-accordion/xg_accordion_init.php 85% from 13 tests

This is the main PHP file of "XG Accordion" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 149 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("xg-accordion.php" instead of "xg_accordion_init.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin13,993 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
CSS81,5701135,436
SVG4033,987
JavaScript537292,741
PHP132241681,829

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity17.00
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods68
▷ Static methods11.47%
▷ Public methods6595.59%
▷ Protected methods22.94%
▷ Private methods11.47%
Functions5
▷ Named functions480.00%
▷ Anonymous functions120.00%
Constants3
▷ Global constants3100.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
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
admin/assets/icon/icon.png1.21KB0.39KB▼ 68.15%