10% post-relation-widget

Code Review | Post Relation Widget

WordPress plugin Post Relation Widget scored10%from 54 tests.

About plugin

  • Plugin page: post-relation-widget
  • Plugin version: 0.14.01
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.8
  • WordPress version: 6.3.1
  • First release: Jul 15, 2013
  • Latest release: Jan 17, 2014
  • Number of updates: 5
  • Update frequency: every 39.6 days
  • Top authors: asimeon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /816 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/post-relation-widget/post-relation-widget.php+537
    Function create_function() is deprecated

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.56ms] Passed 4 tests

Server-side resources used by Post Relation Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.71 ▼33.69
Dashboard /wp-admin2.05 ▼1.265.86 ▼45.40
Posts /wp-admin/edit.php2.05 ▼1.315.71 ▼47.03
Add New Post /wp-admin/post-new.php2.05 ▼3.845.25 ▼92.12
Media Library /wp-admin/upload.php2.05 ▼1.185.63 ▼28.79
Post Relation Widget /wp-admin/options-general.php?page=prw-settings-admin2.056.02

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Post Relation Widget
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.17 ▼1.461.75 ▼0.0640.82 ▼5.92
Dashboard /wp-admin2,210 ▲254.86 ▼0.02112.34 ▼15.5239.25 ▼15.70
Posts /wp-admin/edit.php2,093 ▲12.01 ▲0.0440.09 ▲4.1536.02 ▲6.82
Add New Post /wp-admin/post-new.php1,536 ▼523.33 ▲5.13674.56 ▲53.6067.65 ▼2.91
Media Library /wp-admin/upload.php1,392 ▲104.25 ▲0.0996.89 ▼0.2745.58 ▲0.90
Post Relation Widget /wp-admin/options-general.php?page=prw-settings-admin8012.0728.4030.99

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/post-relation-widget/post-relation-widget.php+537
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_prw_posts
    • wp_prw_relations
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_prw
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=prw-settings-admin
    • > Deprecated in wp-content/plugins/post-relation-widget/post-relation-widget.php+537
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=prw-settings-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=prw-settings-admin
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/post-relation-widget/post-relation-widget.php:13

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 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === post-relation-widget === )
You can look at the official readme.txt

post-relation-widget/post-relation-widget.php Passed 13 tests

The main PHP script in "Post Relation Widget" version 0.14.01 is automatically included on every request by WordPress
71 characters long description:
Manage relations between posts depending on their category in a widget.

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
There were no executable files found in this plugin595 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP14651442
JavaScript18288
CSS14265

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity59.00
▷ Minimum class complexity59.00
▷ Maximum class complexity59.00
Average method complexity3.52
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods23100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/remove.png0.22KB0.17KB▼ 22.27%
images/add.png0.26KB0.27KB0.00%