84% sm-recent-posts

Code Review | SM Recent Post

WordPress plugin SM Recent Post scored84%from 54 tests.

About plugin

  • Plugin page: sm-recent-posts
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-4.8.1
  • WordPress version: 6.3.1
  • First release: Oct 23, 2017
  • Latest release: Oct 23, 2017
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: mahabubs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /494 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

A check of server-side resources used by SM Recent Post
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.37 ▼2.57
Dashboard /wp-admin3.34 ▲0.0448.32 ▼7.13
Posts /wp-admin/edit.php3.39 ▲0.0350.29 ▲3.49
Add New Post /wp-admin/post-new.php5.92 ▲0.0384.47 ▼14.22
Media Library /wp-admin/upload.php3.26 ▲0.0333.42 ▲2.33

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
widget_smrecentpost_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by SM Recent Post
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4313.22 ▼1.191.66 ▼0.3443.90 ▲0.30
Dashboard /wp-admin2,206 ▲185.82 ▲0.9297.70 ▼16.5940.79 ▼7.15
Posts /wp-admin/edit.php2,089 ▼02.03 ▼0.0039.94 ▲2.3334.23 ▼0.81
Add New Post /wp-admin/post-new.php1,533 ▲1923.18 ▲5.67666.34 ▲4.6763.58 ▲8.15
Media Library /wp-admin/upload.php1,382 ▼64.18 ▼0.0495.90 ▼3.8339.74 ▼6.13

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 uninstall procedure has failed, leaving 7 options in the database
    • widget_smrecentpost_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

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
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
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: Call to undefined function plugin_dir_url() in wp-content/plugins/sm-recent-posts/sm-recent-posts.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (YouTube Subscribe widget settings), #2 (Widget output on page.)
The official readme.txt might help

sm-recent-posts/sm-recent-posts.php Passed 13 tests

The primary PHP file in "SM Recent Post" version 1.0.0 is used by WordPress to initiate all plugin functionality
111 characters long description:
Recent post widget plugin for wordpress site sidebar. In author can view author recent post or all recent post.

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
Good job! No executable or dangerous file extensions detected112 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11733112

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity5.75
▷ Minimum method complexity1.00
▷ Maximum method complexity14.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 functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/no-thumbnail.png12.83KB7.39KB▼ 42.43%