78% author-recommended-posts

Code Review | Author Recommended Posts

WordPress plugin Author Recommended Posts scored78%from 54 tests.

About plugin

  • Plugin page: author-recommende...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.1
  • WordPress version: 6.3.1
  • First release: Dec 7, 2012
  • Latest release: Jan 27, 2015
  • Number of updates: 6
  • Update frequency: every 130.0 days
  • Top authors: dtelepathy (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

100+ active /10,756 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.08MB] [CPU: ▼6.20ms] Passed 4 tests

This is a short check of server-side resources used by Author Recommended Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0839.00 ▼2.17
Dashboard /wp-admin3.39 ▲0.0444.82 ▼16.80
Posts /wp-admin/edit.php3.51 ▲0.1549.77 ▲2.07
Add New Post /wp-admin/post-new.php5.99 ▲0.1094.53 ▼7.49
Media Library /wp-admin/upload.php3.31 ▲0.0835.84 ▲1.68
Author Recommended Posts /wp-admin/options-general.php?page=author_recommended_posts3.3031.95

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Author Recommended Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲3513.22 ▼1.221.75 ▼0.1142.24 ▲2.15
Dashboard /wp-admin2,201 ▲134.89 ▼0.00101.52 ▼7.1945.15 ▼2.67
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0437.49 ▼3.2833.49 ▼0.35
Add New Post /wp-admin/post-new.php6,254 ▲4,72626.20 ▲7.85902.70 ▲298.3068.72 ▲17.88
Media Library /wp-admin/upload.php1,386 ▼54.23 ▲0.0697.98 ▲5.1941.40 ▼2.67
Author Recommended Posts /wp-admin/options-general.php?page=author_recommended_posts9502.0623.2227.08

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

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/author-recommended-posts/views/_author-recommended-posts-list.php
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/author-recommended-posts/lib/constants.php:22
    • > PHP Notice
      Undefined variable: format_horizontal in wp-content/plugins/author-recommended-posts/views/_author-recommended-posts-list.php on line 1
    • > PHP Notice
      Undefined variable: page_title in wp-content/plugins/author-recommended-posts/views/options.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/author-recommended-posts/views/_recommended-meta-box.php:2
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/author-recommended-posts/views/_author-recommended-posts-list.php on line 8
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/author-recommended-posts/lib/constants.php on line 20
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/author-recommended-posts/lib/constants.php on line 20
    • > PHP Notice
      Undefined variable: namespace in wp-content/plugins/author-recommended-posts/views/options.php on line 1
    • > PHP Notice
      Undefined variable: recommended_ids in wp-content/plugins/author-recommended-posts/views/_author-recommended-posts-list.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/author-recommended-posts/lib/constants.php:22

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
Please take inspiration from this readme.txt

author-recommended-posts/index.php 92% from 13 tests

The main file in "Author Recommended Posts" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("author-recommended-posts.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin719 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5131241421
CSS238209
JavaScript117889

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity45.00
▷ Minimum class complexity45.00
▷ Maximum class complexity45.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods312.50%
▷ Public methods2187.50%
▷ Protected methods00.00%
▷ Private methods312.50%
Functions0
▷ Named functions00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/admin-sort-icon.png1.33KB0.48KB▼ 63.82%