78% relations-lite

Code Review | Relations lite

WordPress plugin Relations lite scored78%from 54 tests.

About plugin

  • Plugin page: relations-lite
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.1-5.4.1
  • WordPress version: 6.3.1
  • First release: Oct 22, 2018
  • Latest release: Jun 4, 2020
  • Number of updates: 7
  • Update frequency: every 84.4 days
  • Top authors: thekoder (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /499 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.17MB] [CPU: ▼0.00ms] Passed 4 tests

A check of server-side resources used by Relations lite
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1745.20 ▲4.08
Dashboard /wp-admin3.47 ▲0.1645.61 ▼0.59
Posts /wp-admin/edit.php3.58 ▲0.2247.98 ▲2.65
Add New Post /wp-admin/post-new.php6.08 ▲0.1984.29 ▼6.15
Media Library /wp-admin/upload.php3.39 ▲0.1638.14 ▲5.47
Templates /wp-admin/edit.php?post_type=relations_template3.4842.16
Settings /wp-admin/admin.php?page=relations3.3832.30

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 34 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
relations_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Relations lite
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,927 ▲19213.65 ▼0.656.06 ▲3.7446.82 ▲3.76
Dashboard /wp-admin2,244 ▲565.17 ▲0.30102.36 ▲1.8640.79 ▼2.86
Posts /wp-admin/edit.php2,127 ▲412.31 ▲0.3136.92 ▼0.2831.24 ▼3.25
Add New Post /wp-admin/post-new.php6,286 ▲4,77226.29 ▲8.87945.63 ▲245.5752.11 ▼10.86
Media Library /wp-admin/upload.php1,429 ▲444.54 ▲0.3796.36 ▼4.6642.37 ▼2.60
Templates /wp-admin/edit.php?post_type=relations_template1,7322.4833.9029.79
Settings /wp-admin/admin.php?page=relations8942.0633.5126.33

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • relations_options
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/relations-lite/templates/advanced/wrapper-end.php
    • > /wp-content/plugins/relations-lite/templates/simple/wrapper-end.php
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/relations-lite/templates/advanced/content-related-post.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/relations-lite/templates/simple/wrapper-start.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/relations-lite/templates/advanced/wrapper-start.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/relations-lite/includes/view/menu-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_permalink() in wp-content/plugins/relations-lite/templates/simple/content-related-post.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/relations-lite/relations-advanced-related-posts.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/relations-lite/includes/view/metabox-main.php:4

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 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
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Plugin settings), #2 (Related posts templates), #3 (Edit a related post template)
Please take inspiration from this readme.txt

relations-lite/relations-advanced-related-posts.php 85% from 13 tests

The principal PHP file in "Relations lite" v. 1.0.2 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("relations-lite.php" instead of "relations-advanced-related-posts.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin1,191 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP21161313806
CSS340177
PO File16366145
JavaScript317063

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity7.64
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity2.59
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods46
▷ Static methods1532.61%
▷ Public methods4393.48%
▷ Protected methods00.00%
▷ Private methods36.52%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.22MB with 0.14MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png75.74KB29.46KB▼ 61.11%
screenshot-1.png57.68KB22.69KB▼ 60.66%
screenshot-3.png95.84KB37.20KB▼ 61.19%