83% cpw-custom-post-widget

Code Review | CPW Custom Post Widget

WordPress plugin CPW Custom Post Widget scored83%from 54 tests.

About plugin

  • Plugin page: cpw-custom-post-w...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.3
  • WordPress version: 6.3.1
  • First release: Jun 8, 2017
  • Latest release: Jun 8, 2017
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: mehranumr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /653 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.03MB] [CPU: ▼9.38ms] Passed 4 tests

Server-side resources used by CPW Custom Post Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0536.19 ▼3.01
Dashboard /wp-admin3.35 ▲0.0043.88 ▼14.46
Posts /wp-admin/edit.php3.40 ▲0.0448.99 ▲1.16
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.07 ▼17.55
Media Library /wp-admin/upload.php3.28 ▲0.0432.00 ▼2.48

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_cpw_widget
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for CPW Custom Post Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.54 ▼0.841.67 ▼0.5941.07 ▼10.54
Dashboard /wp-admin2,206 ▲155.86 ▲0.99107.40 ▲0.6138.79 ▼1.38
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0339.88 ▼0.8235.18 ▲1.29
Add New Post /wp-admin/post-new.php1,514 ▼1917.64 ▼5.52611.82 ▼21.6753.31 ▲4.20
Media Library /wp-admin/upload.php1,388 ▼04.15 ▼0.0793.47 ▼10.9340.90 ▼1.23

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_cpw_widget
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_image_size() in wp-content/plugins/cpw-custom-post-widget/CPW-Custom-Post-Widget.php:23

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

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

cpw-custom-post-widget/CPW-Custom-Post-Widget.php 85% from 13 tests

The main PHP file in "CPW Custom Post Widget" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cpw-custom-post-widget.php" instead of "CPW-Custom-Post-Widget.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected167 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13657167

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity17.00
▷ Minimum class complexity17.00
▷ Maximum class complexity17.00
Average method complexity3.67
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin