74% wp-recently-viewed

Code Review | WP Recently Viewed

WordPress plugin WP Recently Viewed scored74%from 54 tests.

About plugin

  • Plugin page: wp-recently-viewed
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.8
  • WordPress version: 6.3.1
  • First release: Mar 5, 2014
  • Latest release: Mar 5, 2014
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: eflyjason (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,178 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.72MB] [CPU: ▼49.95ms] Passed 4 tests

This is a short check of server-side resources used by WP Recently Viewed
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.189.67 ▼26.06
Dashboard /wp-admin2.29 ▼1.0512.44 ▼45.74
Posts /wp-admin/edit.php2.30 ▼1.069.84 ▼36.39
Add New Post /wp-admin/post-new.php2.30 ▼3.5910.70 ▼90.08
Media Library /wp-admin/upload.php2.30 ▼0.9310.30 ▼27.60

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_wp_recently_viewed_widget
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Recently Viewed
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲514.32 ▼0.031.92 ▼0.0936.78 ▼5.13
Dashboard /wp-admin2,195 ▲175.61 ▼0.1189.55 ▼14.1642.90 ▼2.13
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0438.58 ▲2.6336.11 ▼0.27
Add New Post /wp-admin/post-new.php1,526 ▼022.92 ▼0.82643.12 ▼32.7759.26 ▲3.34
Media Library /wp-admin/upload.php1,394 ▼64.19 ▼0.0394.75 ▼13.3841.63 ▼8.85

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in wp_recently_viewed_widget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_wp_recently_viewed_widget
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wp-recently-viewed/wp-recently-viewed.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
3 plugin tags: recently, viewed, visitor

wp-recently-viewed/wp-recently-viewed.php Passed 13 tests

The main PHP file in "WP Recently Viewed" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
88 characters long description:
Let visitors see there recently view post. 讓訪客查看他們最近訪問過的文章

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
Everything looks great! No dangerous files found in this plugin195 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript26186
PHP1183459
PO File28850

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.09
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity2.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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
PNG images were not found in this plugin