10% custom-recent-posts-widget-plus

Code Review | Custom Recent Posts Widget Plus

WordPress plugin Custom Recent Posts Widget Plus scored10%from 54 tests.

About plugin

  • Plugin page: custom-recent-pos...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: May 3, 2015
  • Latest release: May 3, 2015
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: javierjara (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,517 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The following installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/custom-recent-posts-widget-plus/custom-recent-posts-widget-plus.php+23
    Methods with the same name as their class will not be constructors in a future version of PHP; category_widget_cat_recent_posts has a deprecated constructor

Server metrics [RAM: ▼1.92MB] [CPU: ▼57.00ms] Passed 4 tests

An overview of server-side resources used by Custom Recent Posts Widget Plus
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.63 ▼36.33
Dashboard /wp-admin2.10 ▼1.256.86 ▼57.23
Posts /wp-admin/edit.php2.10 ▼1.266.33 ▼45.80
Add New Post /wp-admin/post-new.php2.10 ▼3.795.35 ▼88.62
Media Library /wp-admin/upload.php2.10 ▼1.134.92 ▼30.77

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_category_widget_cat_recent_posts
widget_recent-posts
can_compress_scripts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Custom Recent Posts Widget Plus
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲4413.26 ▼0.901.72 ▼0.2644.20 ▲1.71
Dashboard /wp-admin2,221 ▲185.77 ▲0.8698.57 ▼8.2139.21 ▼6.26
Posts /wp-admin/edit.php2,097 ▼32.14 ▲0.1035.02 ▼2.3032.94 ▼2.45
Add New Post /wp-admin/post-new.php1,526 ▼523.47 ▲0.74681.75 ▲54.1855.62 ▼7.45
Media Library /wp-admin/upload.php1,391 ▼64.23 ▲0.00100.54 ▼2.5949.18 ▲3.21

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/custom-recent-posts-widget-plus/custom-recent-posts-widget-plus.php+23
    Methods with the same name as their class will not be constructors in a future version of PHP; category_widget_cat_recent_posts has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_category_widget_cat_recent_posts

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)
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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-recent-posts-widget-plus/custom-recent-posts-widget-plus.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
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 to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The widget UI), #2 (The widget UI)
The official readme.txt is a good inspiration

custom-recent-posts-widget-plus/custom-recent-posts-widget-plus.php 92% from 13 tests

The primary PHP file in "Custom Recent Posts Widget Plus" version 1.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Make the plugin description longer than 10 characters (currently 0 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected95 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1601495

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity11.00
▷ Minimum class complexity11.00
▷ Maximum class complexity11.00
Average method complexity3.50
▷ 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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png7.25KB3.03KB▼ 58.27%
screenshot-1.png4.66KB2.58KB▼ 44.73%