83% relative-posts

Code Review | Relative Posts

WordPress plugin Relative Posts scored83%from 54 tests.

About plugin

  • Plugin page: relative-posts
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-4.9
  • WordPress version: 6.3.1
  • First release: Oct 21, 2012
  • Latest release: Jul 6, 2018
  • Number of updates: 27
  • Update frequency: every 77.2 days
  • Top authors: paaggeli (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,809 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼6.39ms] Passed 4 tests

A check of server-side resources used by Relative Posts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0625.96 ▼15.58
Dashboard /wp-admin3.32 ▲0.0245.63 ▼2.18
Posts /wp-admin/edit.php3.37 ▲0.0145.09 ▲0.51
Add New Post /wp-admin/post-new.php5.90 ▲0.0280.46 ▼8.31
Media Library /wp-admin/upload.php3.25 ▲0.0135.59 ▲4.30

Server storage [IO: ▲0.30MB] [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: 11 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_pa_relative
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Relative Posts: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲6714.74 ▲0.141.76 ▼0.1245.05 ▲0.39
Dashboard /wp-admin2,206 ▲175.86 ▲0.01101.72 ▼9.5238.15 ▼4.93
Posts /wp-admin/edit.php2,092 ▲32.01 ▼0.0035.44 ▲0.1830.96 ▼4.42
Add New Post /wp-admin/post-new.php1,542 ▲818.19 ▼4.75605.85 ▼59.6657.48 ▲6.15
Media Library /wp-admin/upload.php1,382 ▼94.23 ▼0.0095.66 ▼1.9142.84 ▲0.07

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • widget_pa_relative
    • 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
Good news, no errors were detected

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
The following issues need your attention
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/relative-posts/templates/posts-with-thumbnails.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/relative-posts/relative.php:14
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/relative-posts/templates/form.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/relative-posts/templates/posts-without-thumbnails.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Admin Panel), #2 (Post Page), #3 (Post Page With Thumbnail Images)
  • Donate link: Invalid url: ""
You can take inspiration from this readme.txt

relative-posts/relative.php 92% from 13 tests

The main PHP script in "Relative Posts" version 1.3.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("relative-posts.php" instead of "relative.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin185 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP52916173
CSS12012

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity4.00
▷ Minimum class complexity2.00
▷ Maximum class complexity6.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin