84% cpt-recent-entries-widgets

Code Review | Custom Post Type Recent Entries Widget

WordPress plugin Custom Post Type Recent Entries Widget scored84%from 54 tests.

About plugin

  • Plugin page: cpt-recent-entrie...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 17, 2020
  • Latest release: Jun 17, 2020
  • Number of updates: 6
  • Update frequency: every 1.2 days
  • Top authors: mavenium (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /496 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
Installer ran successfully

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

A check of server-side resources used by Custom Post Type Recent Entries Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.18 ▲1.22
Dashboard /wp-admin3.33 ▲0.0343.18 ▼3.72
Posts /wp-admin/edit.php3.39 ▲0.0343.06 ▼4.44
Add New Post /wp-admin/post-new.php5.92 ▲0.0377.35 ▼13.88
Media Library /wp-admin/upload.php3.26 ▲0.0334.58 ▼0.48

Server storage [IO: ▲0.04MB] [DB: ▲0.07MB] Passed 3 tests

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Post Type Recent Entries Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.72 ▲0.371.76 ▼0.1136.77 ▼4.52
Dashboard /wp-admin2,195 ▲185.62 ▼0.0881.81 ▼6.7937.68 ▼5.80
Posts /wp-admin/edit.php2,100 ▼01.99 ▼0.0033.68 ▼2.7137.16 ▲1.73
Add New Post /wp-admin/post-new.php1,526 ▼022.95 ▲1.78691.38 ▲6.9761.36 ▼10.64
Media Library /wp-admin/upload.php1,400 ▼04.19 ▼0.0595.87 ▼0.3644.14 ▲0.85

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 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 did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_cpt_recent_entries
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

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
Everything seems fine, however 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
Almost there! Just fix the following items
  • 1× 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/cpt-recent-entries-widgets/cpt-recent-entries.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: recent, custom, entries, custom-post-type, widgets...

cpt-recent-entries-widgets/cpt-recent-entries.php 92% from 13 tests

The primary PHP file in "Custom Post Type Recent Entries Widget" version 1.0.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cpt-recent-entries-widgets.php" instead of "cpt-recent-entries.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
Good job! No executable or dangerous file extensions detected118 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1273686
PO File16632

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity12.00
▷ Minimum class complexity12.00
▷ Maximum class complexity12.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity8.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%
Functions1
▷ Named functions1100.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