83% faq-accordion-by-widgetic

Code Review | FAQ Accordion

WordPress plugin FAQ Accordion scored83%from 54 tests.

About plugin

  • Plugin page: faq-accordion-by-...
  • Plugin version: 1.0.35
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.0
  • WordPress version: 6.3.1
  • First release: Mar 17, 2022
  • Latest release: Jul 1, 2022
  • Number of updates: 55
  • Update frequency: every 5.4 days
  • Top authors: widgetic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /889 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▲333.66ms] 75% from 4 tests

Analyzing server-side resources used by FAQ Accordion
Please have a look at the following items
  • Extra CPU: The extra CPU usage must be under 200.00ms (currently 333.66ms on /wp-admin/upload.php)
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.16406.88 ▲365.36
Dashboard /wp-admin3.46 ▲0.11373.18 ▲312.28
Posts /wp-admin/edit.php3.51 ▲0.15302.14 ▲255.75
Add New Post /wp-admin/post-new.php6.04 ▲0.16492.42 ▲401.26
Media Library /wp-admin/upload.php3.38 ▲0.15506.37 ▲474.35

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 32 new files
Database: no new tables, 7 new options
New WordPress options
widgetic/secret
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for FAQ Accordion
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /5,009 ▲2,26329.59 ▲15.45101.31 ▲99.3732.54 ▼12.66
Dashboard /wp-admin3,582 ▲1,39112.74 ▲7.79242.71 ▲131.4482.33 ▲40.44
Posts /wp-admin/edit.php3,390 ▲1,30112.84 ▲10.84166.78 ▲132.2338.72 ▲3.03
Add New Post /wp-admin/post-new.php2,508 ▲96629.22 ▲10.88820.50 ▲210.4341.53 ▼7.00
Media Library /wp-admin/upload.php1,778 ▲39011.66 ▲7.46226.97 ▲122.1840.47 ▼3.92

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widgetic/secret
    • widget_theysaidso_widget
    • theysaidso_admin_options

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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/faq-accordion-by-widgetic/block.php:110
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/faq-accordion-by-widgetic/dashboard.php:4
    • > PHP Notice
      Undefined variable: blockPath in wp-content/plugins/faq-accordion-by-widgetic/block.php on line 29
    • > PHP Notice
      Undefined variable: widgetMeta in wp-content/plugins/faq-accordion-by-widgetic/block.php on line 29
    • > PHP Notice
      Undefined variable: blockWidgetId in wp-content/plugins/faq-accordion-by-widgetic/block.php on line 29

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
Please take inspiration from this readme.txt

faq-accordion-by-widgetic/index.php 92% from 13 tests

The main PHP script in "FAQ Accordion" version 1.0.35 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("faq-accordion-by-widgetic.php" instead of "index.php")

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
There were no executable files found in this plugin1,378 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
JSON500753
CSS37458432
PHP43055170
SVG10021
JavaScript2012

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.13
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%
Functions11
▷ Named functions00.00%
▷ Anonymous functions11100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.84MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png3.99KB1.25KB▼ 68.72%
assets/screenshot-3.png198.26KB207.99KB0.00%
assets/screenshot-2.png592.98KB192.66KB▼ 67.51%
assets/banner-1544x500.png26.23KB7.22KB▼ 72.46%
assets/widgetic_icon.png1.94KB2.03KB0.00%