84% smart-recent-posts-widget

Code Review | Smart Recent Posts Widget

WordPress plugin Smart Recent Posts Widget scored84%from 54 tests.

About plugin

  • Plugin page: smart-recent-post...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.1
  • WordPress version: 6.3.1
  • First release: Aug 2, 2016
  • Latest release: Aug 5, 2023
  • Number of updates: 25
  • Update frequency: every 102.4 days
  • Top authors: 6hourcreative (40%)idenovasi (36%)satrya (32%)

Code review

54 tests

User reviews

29 reviews

Install metrics

10,000+ active /105,800 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
Installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼4.15ms] Passed 4 tests

An overview of server-side resources used by Smart Recent Posts Widget
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1647.82 ▼6.91
Dashboard /wp-admin3.46 ▲0.1657.50 ▼4.70
Posts /wp-admin/edit.php3.57 ▲0.2252.54 ▼8.01
Add New Post /wp-admin/post-new.php6.04 ▲0.16104.91 ▲3.81
Media Library /wp-admin/upload.php3.38 ▲0.1540.63 ▲3.03

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

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

Browser metrics Passed 4 tests

Smart Recent Posts Widget: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.34 ▼0.382.51 ▲0.8641.80 ▼5.84
Dashboard /wp-admin2,197 ▲205.55 ▼0.0484.95 ▼16.3740.12 ▼3.36
Posts /wp-admin/edit.php2,102 ▼12.04 ▲0.0837.90 ▲1.3934.89 ▼2.04
Add New Post /wp-admin/post-new.php1,530 ▲223.21 ▲0.41615.98 ▼10.4750.70 ▼3.84
Media Library /wp-admin/upload.php1,396 ▼14.23 ▲0.0798.06 ▼8.1643.17 ▼2.36

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_srpw_widget
    • widget_recent-comments
    • can_compress_scripts

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/smart-recent-posts-widget/includes/widget.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
The official readme.txt is a good inspiration

smart-recent-posts-widget/srpw.php 92% from 13 tests

The main PHP script in "Smart Recent Posts Widget" version 1.0.3 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("smart-recent-posts-widget.php" instead of "srpw.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected775 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4178141608
CSS2389167

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity18.50
▷ Minimum class complexity1.00
▷ Maximum class complexity36.00
Average method complexity4.18
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
No PNG files were detected