84% custom-post-accordion

Code Review | Custom Posts Accordion

WordPress plugin Custom Posts Accordion scored84%from 54 tests.

About plugin

  • Plugin page: custom-post-accor...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-5.3.2
  • WordPress version: 6.3.1
  • First release: Sep 1, 2016
  • Latest release: Feb 3, 2020
  • Number of updates: 14
  • Update frequency: every 89.3 days
  • Top authors: dakiriki (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,025 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼9.09ms] Passed 4 tests

A check of server-side resources used by Custom Posts Accordion
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0135.48 ▼6.21
Dashboard /wp-admin3.32 ▼0.0343.56 ▼19.17
Posts /wp-admin/edit.php3.37 ▲0.0145.30 ▼2.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0181.43 ▼8.70
Media Library /wp-admin/upload.php3.24 ▲0.0133.58 ▲1.38

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Posts Accordion
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,912 ▲16613.50 ▼1.098.55 ▲6.3137.72 ▼6.19
Dashboard /wp-admin2,200 ▲125.84 ▼0.02104.32 ▼16.4041.32 ▼3.17
Posts /wp-admin/edit.php2,089 ▲32.03 ▲0.0535.28 ▼1.0229.33 ▼3.87
Add New Post /wp-admin/post-new.php1,533 ▲1923.14 ▲5.49664.86 ▼18.9251.89 ▼1.10
Media Library /wp-admin/upload.php1,388 ▲34.31 ▲0.1293.95 ▼7.7243.87 ▲0.04

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

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-post-accordion/gw-custom-post-accordion.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === custom-post-accordion === )
The official readme.txt is a good inspiration

custom-post-accordion/gw-custom-post-accordion.php 92% from 13 tests

The main file in "Custom Posts Accordion" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("custom-post-accordion.php" instead of "gw-custom-post-accordion.php")

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
Success! There were no dangerous files found in this plugin38 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1221538

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.06
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin