83% posts-viewed-recently

Code Review | Posts Viewed Recently

WordPress plugin Posts Viewed Recently scored83%from 54 tests.

About plugin

  • Plugin page: posts-viewed-rece...
  • Plugin version: 1.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.6
  • WordPress version: 6.3.1
  • First release: Apr 29, 2014
  • Latest release: Dec 10, 2020
  • Number of updates: 54
  • Update frequency: every 44.8 days
  • Top authors: amitaits (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active /12,565 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.33ms] Passed 4 tests

This is a short check of server-side resources used by Posts Viewed Recently
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.23 ▼4.47
Dashboard /wp-admin3.32 ▲0.0163.93 ▲10.39
Posts /wp-admin/edit.php3.37 ▲0.0148.21 ▼3.49
Add New Post /wp-admin/post-new.php5.92 ▲0.0394.06 ▼6.28
Media Library /wp-admin/upload.php3.24 ▲0.0139.01 ▲4.93

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent_viewed_posts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Posts Viewed Recently
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.66 ▼0.631.73 ▼0.2043.46 ▼3.04
Dashboard /wp-admin2,205 ▲145.85 ▲0.97102.03 ▲1.0641.52 ▲3.30
Posts /wp-admin/edit.php2,091 ▲22.06 ▲0.0642.42 ▲1.2735.28 ▼0.12
Add New Post /wp-admin/post-new.php1,530 ▲1623.12 ▲5.66616.10 ▼30.5149.05 ▼9.54
Media Library /wp-admin/upload.php1,384 ▼44.23 ▲0.0297.26 ▼9.9740.43 ▼3.59

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent_viewed_posts
    • db_upgraded
    • 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
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-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/posts-viewed-recently/ft_shortcode.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Widget options), #2 (Viewing the widget with thumbnail)
  • Tags: There are too many tags (17 tag instead of maximum 10)
You can take inspiration from this readme.txt

posts-viewed-recently/recent_viewed_posts.php 92% from 13 tests

The principal PHP file in "Posts Viewed Recently" v. 1.3.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("posts-viewed-recently.php" instead of "recent_viewed_posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected239 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP21827219
JavaScript12016
Markdown1203
CSS1001

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.38
Average class complexity45.00
▷ Minimum class complexity45.00
▷ Maximum class complexity45.00
Average method complexity12.00
▷ Minimum method complexity1.00
▷ Maximum method complexity24.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%
Functions5
▷ Named functions5100.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.05MB with 0.03MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png40.00KB12.01KB▼ 69.98%
screenshot-1.png11.23KB7.73KB▼ 31.14%