84% wp-custom-posts-widgets

Code Review | Wordpress Custom Posts Widgets

WordPress plugin Wordpress Custom Posts Widgets scored84%from 54 tests.

About plugin

  • Plugin page: wp-custom-posts-w...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.9.3
  • WordPress version: 6.3.1
  • First release: Mar 8, 2019
  • Latest release: Mar 22, 2022
  • Number of updates: 4
  • Update frequency: every 277.8 days
  • Top authors: d3logics (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /634 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.87ms] Passed 4 tests

Server-side resources used by Wordpress Custom Posts Widgets
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1340.20 ▼8.25
Dashboard /wp-admin3.44 ▲0.1349.74 ▼0.96
Posts /wp-admin/edit.php3.49 ▲0.1349.27 ▼1.79
Add New Post /wp-admin/post-new.php6.04 ▲0.1591.38 ▼12.49
Media Library /wp-admin/upload.php3.36 ▲0.1335.68 ▼0.73

Server storage [IO: ▲0.05MB] [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: 14 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_sticky-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Wordpress Custom Posts Widgets
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.35 ▲0.062.01 ▼0.1341.96 ▼2.35
Dashboard /wp-admin2,196 ▲195.49 ▼0.1686.57 ▼13.1238.98 ▼5.61
Posts /wp-admin/edit.php2,107 ▲42.01 ▲0.0241.67 ▲2.9535.47 ▼2.44
Add New Post /wp-admin/post-new.php1,530 ▼723.11 ▲4.86652.60 ▼11.8758.21 ▼12.27
Media Library /wp-admin/upload.php1,398 ▼24.22 ▲0.0196.64 ▼8.5341.73 ▼2.98

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_sticky-posts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/wp-custom-posts-widgets/templates/legacy.php:15
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-custom-posts-widgets/templates/standard.php on line 9
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/wp-custom-posts-widgets/templates/standard.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wp-custom-posts-widgets/wordpress-custom-widgets.php:28
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-custom-posts-widgets/templates/legacy.php on line 9
    • > PHP Notice
      Undefined variable: dtlwcpw_query in wp-content/plugins/wp-custom-posts-widgets/templates/standard.php on line 17
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/wp-custom-posts-widgets/templates/standard.php:17
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/wp-custom-posts-widgets/templates/legacy.php on line 9
    • > PHP Notice
      Undefined variable: dtlwcpw_query in wp-content/plugins/wp-custom-posts-widgets/templates/legacy.php on line 15

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 Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: wordpress post widget, custom post widget, post widget with image, post widget with thumbnail

wp-custom-posts-widgets/wordpress-custom-widgets.php 85% from 13 tests

The entry point to "Wordpress Custom Posts Widgets" version 1.0.1 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-custom-posts-widgets.php" instead of "wordpress-custom-widgets.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected999 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP318456798
Sass2150114
JSON20059
JavaScript382926
CSS2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity98.00
▷ Minimum class complexity98.00
▷ Maximum class complexity98.00
Average method complexity14.86
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.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

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