83% simple-recent-post-widget

Code Review | Simple Recent Post Widget

WordPress plugin Simple Recent Post Widget scored83%from 54 tests.

About plugin

  • Plugin page: simple-recent-pos...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7
  • WordPress version: 6.3.1
  • First release: Nov 14, 2016
  • Latest release: Nov 23, 2016
  • Number of updates: 6
  • Update frequency: every 0.8 days
  • Top authors: jobayer007 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,373 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 gracefully, with no errors

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

Analyzing server-side resources used by Simple Recent Post Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0335.43 ▼5.56
Dashboard /wp-admin3.34 ▲0.0344.50 ▼7.37
Posts /wp-admin/edit.php3.39 ▲0.0348.13 ▲0.01
Add New Post /wp-admin/post-new.php5.92 ▲0.0394.60 ▼13.06
Media Library /wp-admin/upload.php3.26 ▲0.0333.42 ▲0.53

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_jobayer-recent-post-widget

Browser metrics Passed 4 tests

Simple Recent Post Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5614.48 ▲0.181.76 ▼0.1742.67 ▼3.78
Dashboard /wp-admin2,206 ▲184.85 ▼0.20100.08 ▼16.8740.61 ▼4.85
Posts /wp-admin/edit.php2,092 ▲32.04 ▼0.0139.53 ▲3.2333.68 ▲0.94
Add New Post /wp-admin/post-new.php1,537 ▼523.20 ▲4.95691.79 ▲43.0347.69 ▼7.63
Media Library /wp-admin/upload.php1,391 ▲64.18 ▼0.1799.12 ▼3.1343.36 ▼5.01

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_jobayer-recent-post-widget
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

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 fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-recent-post-widget/recent-post.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === simple-recent-post-widget === )
You can take inspiration from this readme.txt

simple-recent-post-widget/recent-post.php 85% from 13 tests

Analyzing the main PHP file in "Simple Recent Post Widget" version 1.0
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-recent-post-widget.php" instead of "recent-post.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
No dangerous file extensions were detected172 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP14414102
CSS10070

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity19.00
▷ Minimum class complexity19.00
▷ Maximum class complexity19.00
Average method complexity7.00
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.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
No PNG images were found in this plugin