84% accordion-archive-widget

Code Review | Accordion Archive Widget

WordPress plugin Accordion Archive Widget scored84%from 54 tests.

About plugin

  • Plugin page: accordion-archive...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: May 30, 2014
  • Latest release: Dec 12, 2015
  • Number of updates: 4
  • Update frequency: every 140.3 days
  • Top authors: pathartl (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /3,213 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
Install script ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▲2.72ms] Passed 4 tests

An overview of server-side resources used by Accordion Archive Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0341.93 ▲0.65
Dashboard /wp-admin3.37 ▲0.0358.92 ▲8.32
Posts /wp-admin/edit.php3.49 ▲0.0953.38 ▲1.91
Add New Post /wp-admin/post-new.php5.95 ▲0.0394.84 ▲0.57
Media Library /wp-admin/upload.php3.30 ▲0.0341.33 ▲7.76

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_accordion_archives
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Accordion Archive Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,897 ▲13613.41 ▼0.949.42 ▲7.8045.28 ▲2.63
Dashboard /wp-admin2,189 ▲155.63 ▲0.0592.85 ▲2.7744.56 ▲1.70
Posts /wp-admin/edit.php2,103 ▼01.99 ▼0.0240.64 ▼4.9435.06 ▼5.95
Add New Post /wp-admin/post-new.php1,526 ▼023.61 ▲0.61683.80 ▲14.7753.97 ▼6.84
Media Library /wp-admin/upload.php1,403 ▲34.20 ▼0.0394.86 ▼11.0645.67 ▲1.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_accordion_archives
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/accordion-archive-widget/accordion-archive-widget.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This is an image of the collapsed accordion.), #2 (This is an image of the accordion expanded revealing the months.)
The official readme.txt might help

accordion-archive-widget/accordion-archive-widget.php Passed 13 tests

The main PHP script in "Accordion Archive Widget" version 1.0.1 is automatically included on every request by WordPress
86 characters long description:
An archive widget that collapses the standard archive widget into an accordion by year

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected94 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1292679
CSS1106
JavaScript1316
Markdown1103

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png2.87KB1.25KB▼ 56.50%
screenshot-2.png3.95KB1.90KB▼ 51.87%