10% smart-recent-post

Code Review | Smart Recent Post

WordPress plugin Smart Recent Post scored10%from 54 tests.

About plugin

  • Plugin page: smart-recent-post
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.4
  • WordPress version: 6.3.1
  • First release: Aug 1, 2012
  • Latest release: Nov 5, 2019
  • Number of updates: 7
  • Update frequency: every 378.9 days
  • Top authors: sandeep816 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /7,235 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/smart-recent-post/index.php+219
    Function create_function() is deprecated

Server metrics [RAM: ▼1.85MB] [CPU: ▼60.16ms] Passed 4 tests

Server-side resources used by Smart Recent Post
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.324.85 ▼34.33
Dashboard /wp-admin2.16 ▼1.187.22 ▼60.06
Posts /wp-admin/edit.php2.16 ▼1.195.29 ▼48.35
Add New Post /wp-admin/post-new.php2.16 ▼3.726.79 ▼97.88
Media Library /wp-admin/upload.php2.16 ▼1.065.17 ▼30.43

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_smart_recent_post_widget
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Smart Recent Post
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲514.71 ▲0.351.49 ▼0.5841.22 ▼0.30
Dashboard /wp-admin2,198 ▲185.57 ▼0.0293.12 ▼0.6743.29 ▲1.15
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0140.63 ▲1.6436.00 ▼5.14
Add New Post /wp-admin/post-new.php1,526 ▼2023.77 ▲5.43646.71 ▲28.2652.85 ▼6.40
Media Library /wp-admin/upload.php1,400 ▼04.40 ▲0.11100.44 ▼6.3344.18 ▼2.57

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/smart-recent-post/index.php+219
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_smart_recent_post_widget
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

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 | 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/smart-recent-post/index.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Widget Options), #2 (Viewing the Widget)
The official readme.txt might help

smart-recent-post/index.php 92% from 13 tests

The main PHP script in "Smart Recent Post" version 2.0 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("smart-recent-post.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin175 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP11742169
CSS1106

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.26
Average class complexity28.00
▷ Minimum class complexity28.00
▷ Maximum class complexity28.00
Average method complexity6.40
▷ Minimum method complexity1.00
▷ Maximum method complexity17.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%
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

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