84% sp-custom-post-widget

Code Review | SP Custom Post Widget

WordPress plugin SP Custom Post Widget scored84%from 54 tests.

About plugin

  • Plugin page: sp-custom-post-wi...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Jun 1, 2019
  • Latest release: Jun 1, 2019
  • Number of updates: 5
  • Update frequency: every 0.2 days
  • Top authors: itsmesulav (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /527 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.01MB] [CPU: ▼2.63ms] Passed 4 tests

A check of server-side resources used by SP Custom Post Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0134.28 ▼2.93
Dashboard /wp-admin3.31 ▲0.0143.68 ▼2.04
Posts /wp-admin/edit.php3.37 ▲0.0148.83 ▲5.61
Add New Post /wp-admin/post-new.php5.90 ▲0.0185.41 ▼2.37
Media Library /wp-admin/upload.php3.24 ▲0.0133.29 ▼3.17

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

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

Browser metrics Passed 4 tests

Checking browser requirements for SP Custom Post Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6914.48 ▲0.101.57 ▼0.4640.26 ▼2.17
Dashboard /wp-admin2,206 ▲186.03 ▲1.13110.06 ▲4.1341.35 ▼0.25
Posts /wp-admin/edit.php2,086 ▼02.05 ▲0.0033.34 ▼4.4733.49 ▲0.53
Add New Post /wp-admin/post-new.php1,537 ▲423.12 ▼0.04637.39 ▼19.5556.33 ▲10.04
Media Library /wp-admin/upload.php1,388 ▼04.14 ▼0.1099.39 ▼2.2943.56 ▼0.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_spspsp_widget_custom
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

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 | 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× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/sp-custom-post-widget/inc/sp-scripts-widget.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
8 plugin tags: widget for custom posts, blogs, showcase, custom post types, clients...

sp-custom-post-widget/sp-custom-post-widget.php Passed 13 tests

"SP Custom Post Widget" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
101 characters long description:
This plugin helps you showcase your posts from the specified post type in a native wordpress widgets.

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
Everything looks great! No dangerous files found in this plugin101 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP21449101

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin