10% related-content-by-plugz

Code Review | Related Content by Plugz

WordPress plugin Related Content by Plugz scored10%from 54 tests.

About plugin

  • Plugin page: related-content-b...
  • Plugin version: 1.6.2
  • PHP version: 7.4.16
  • WordPress compatibility: 1.8-4.3.1
  • WordPress version: 6.3.1
  • First release: Jun 25, 2014
  • Latest release: May 31, 2016
  • Number of updates: 87
  • Update frequency: every 8.1 days
  • Top authors: csiszi (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

10+ active /13,395 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/related-content-by-plugz/plugz.php+719
    Function create_function() is deprecated

Server metrics [RAM: ▼1.68MB] [CPU: ▼50.98ms] Passed 4 tests

A check of server-side resources used by Related Content by Plugz
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.31 ▼1.156.96 ▼38.26
Dashboard /wp-admin2.33 ▼0.9711.25 ▼40.99
Posts /wp-admin/edit.php2.33 ▼1.038.97 ▼41.01
Add New Post /wp-admin/post-new.php2.33 ▼3.568.13 ▼83.67
Media Library /wp-admin/upload.php2.33 ▼0.907.39 ▼33.59
Help /wp-admin/admin.php?page=plugz/help2.339.57
Widget /wp-admin/admin.php?page=plugz/widgets2.3310.91
Settings /wp-admin/admin.php?page=plugz/settings2.339.32

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 167 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
widget_plugz_widget
plugz_start-index-schedule-timestamp
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Related Content by Plugz: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲4914.77 ▲0.381.84 ▼0.1242.22 ▼3.35
Dashboard /wp-admin2,239 ▲514.93 ▼0.8797.33 ▼21.7691.42 ▲47.99
Posts /wp-admin/edit.php2,128 ▲391.98 ▼0.0136.14 ▼2.6038.39 ▲1.32
Add New Post /wp-admin/post-new.php1,557 ▲3718.21 ▼4.81668.56 ▲21.4559.44 ▲1.69
Media Library /wp-admin/upload.php1,415 ▲274.13 ▼0.07101.62 ▼13.4371.14 ▲23.68
Help /wp-admin/admin.php?page=plugz/help9132.0125.7424.96
Widget /wp-admin/admin.php?page=plugz/widgets8042.0424.9127.17
Settings /wp-admin/admin.php?page=plugz/settings8112.0524.6227.27

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/related-content-by-plugz/plugz.php+719
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 8 options in the database
    • plugz_start-index-schedule-timestamp
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_plugz_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=plugz/settings
    • > Deprecated in wp-content/plugins/related-content-by-plugz/plugz.php+719
    Function create_function() is deprecated
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=plugz/settings
    • > Notice in wp-content/plugins/related-content-by-plugz/admin/common.php+23
    Trying to access array offset on value of type bool
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=plugz/settings
    • > Notice in wp-content/plugins/related-content-by-plugz/admin/common.php+44
    Undefined offset: 2
    • > GET request to /wp-admin/admin.php?page=plugz/widgets
    • > Notice in wp-content/plugins/related-content-by-plugz/admin/widget/index.php+134
    Undefined variable: errors

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
Please take a closer look at the following
  • 6× PHP files output text when accessed directly:
    • > /wp-content/plugins/related-content-by-plugz/admin/settings/index.php
    • > /wp-content/plugins/related-content-by-plugz/admin/widget/add.php
    • > /wp-content/plugins/related-content-by-plugz/admin/widget/footer.php
    • > /wp-content/plugins/related-content-by-plugz/admin/help/index.php
    • > /wp-content/plugins/related-content-by-plugz/admin/widget/header.php
    • > /wp-content/plugins/related-content-by-plugz/admin/widget/edit.php
  • 63× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      Use of undefined constant PLUGZ_JS_DIR - assumed 'PLUGZ_JS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-content-by-plugz/admin/widget/header.php on line 31
    • > PHP Notice
      Undefined variable: plugzConnected in wp-content/plugins/related-content-by-plugz/admin/settings/index.php on line 216
    • > PHP Warning
      Use of undefined constant PLUGZ_JS_DIR - assumed 'PLUGZ_JS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-content-by-plugz/admin/widget/header.php on line 27
    • > PHP Warning
      Use of undefined constant PLUGZ_JS_DIR - assumed 'PLUGZ_JS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-content-by-plugz/admin/widget/header.php on line 20
    • > PHP Warning
      Use of undefined constant PLUGZ_JS_DIR - assumed 'PLUGZ_JS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-content-by-plugz/admin/widget/header.php on line 20
    • > PHP Warning
      Use of undefined constant PLUGZ_JS_DIR - assumed 'PLUGZ_JS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-content-by-plugz/admin/widget/header.php on line 28
    • > PHP Warning
      Use of undefined constant PLUGZ_CSS_DIR - assumed 'PLUGZ_CSS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-content-by-plugz/admin/widget/header.php on line 15
    • > PHP Warning
      Use of undefined constant PLUGZ_JS_DIR - assumed 'PLUGZ_JS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-content-by-plugz/admin/widget/header.php on line 19
    • > PHP Warning
      Use of undefined constant PLUGZ_JS_DIR - assumed 'PLUGZ_JS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-content-by-plugz/admin/widget/header.php on line 24
    • > PHP Warning
      Use of undefined constant PLUGZ_JS_DIR - assumed 'PLUGZ_JS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/related-content-by-plugz/admin/widget/header.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% 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 your attention:
  • Tags: There are too many tags (24 tag instead of maximum 10)
The official readme.txt is a good inspiration

related-content-by-plugz/plugz.php 77% from 13 tests

Analyzing the main PHP file in "Related Content by Plugz" version 1.6.2
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 147 characters long)
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("related-content-by-plugz.php" instead of "plugz.php")

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
Good job! No executable or dangerous file extensions detected16,303 lines of code in 74 files:
LanguageFilesBlank linesComment linesLines of code
CSS269371926,705
SVG16004,096
JavaScript186575653,565
PHP132522271,896
HTML12041

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity18.00
▷ Minimum class complexity11.00
▷ Maximum class complexity25.00
Average method complexity5.86
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.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
35 PNG files occupy 0.13MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/template3.png2.52KB1.28KB▼ 49.28%
images/colorpicker/colorpicker_submit.png0.96KB1.04KB0.00%
images/tick16.png3.24KB0.59KB▼ 81.90%
images/colorpicker/colorpicker_rgb_b.png0.95KB0.76KB▼ 19.48%
images/template1.png4.90KB2.40KB▼ 51.09%