10% addthis-related-posts

Code Review | WordPress Related Posts Plugin – AddThis

WordPress plugin WordPress Related Posts Plugin – AddThis scored 10% from 54 tests.

About plugin

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active / 46,941 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
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/addthis-related-posts/backend/AddThisPlugin.php+203
    Undefined index: cms_version

Server metrics [RAM: ▲1.18MB] [CPU: ▼287.77ms] Passed 4 tests

Analyzing server-side resources used by WordPress Related Posts Plugin – AddThis
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.67 ▲1.1563.65 ▲16.99
Dashboard /wp-admin4.61 ▲1.2040.14 ▲6.99
Posts /wp-admin/edit.php4.84 ▲1.1943.89 ▲7.46
Add New Post /wp-admin/post-new.php8.14 ▲1.16100.77 ▼1,172.28
Media Library /wp-admin/upload.php4.56 ▲1.2631.31 ▲6.77
Related Posts /wp-admin/admin.php?page=addthis_recommended_content4.4829.89
Advanced Settings /wp-admin/admin.php?page=addthis_advanced_settings4.4831.03
Home /wp-admin/admin.php?page=addthis_registration4.4829.13

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 321 new files
Database: no new tables, 5 new options
New WordPress options
addthis_follow_buttons_settings
widget_addthis_global_options_widget
addthis_shared_settings
addthis_recommended_content_settings
widget_addthis_tool_by_class_name_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WordPress Related Posts Plugin – AddThis
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,899 ▲14518.05 ▲2.2577.59 ▲71.482.71 ▼0.04
Dashboard /wp-admin2,939 ▲846.29 ▲0.10120.29 ▼19.61171.70 ▲11.56
Posts /wp-admin/edit.php2,728 ▲403.14 ▼0.1063.53 ▼2.48141.19 ▼2.36
Add New Post /wp-admin/post-new.php1,735 ▲6118.35 ▼3.96395.18 ▼9.79209.68 ▲36.78
Media Library /wp-admin/upload.php1,740 ▲425.63 ▲0.07137.53 ▼18.15218.70 ▲28.73
Related Posts /wp-admin/admin.php?page=addthis_recommended_content3,6688.67310.09146.40
Advanced Settings /wp-admin/admin.php?page=addthis_advanced_settings7,78512.27400.56220.13
Home /wp-admin/admin.php?page=addthis_registration4,8848.29437.80174.96

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/addthis-related-posts/backend/AddThisPlugin.php+237
    Undefined index: cms_version
  • This plugin does not fully uninstall, leaving 5 options in the database
    • addthis_recommended_content_settings
    • addthis_follow_buttons_settings
    • addthis_shared_settings
    • widget_addthis_global_options_widget
    • widget_addthis_tool_by_class_name_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following
  • 29× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/addthis-related-posts/backend/AddThisGlobalOptionsWidget.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-related-posts/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-related-posts/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-related-posts/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-related-posts/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-related-posts/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-related-posts/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-related-posts/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-related-posts/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-related-posts/backend/AddThisAdminUtilities.php:63

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=addthis_registration
    • > Network (severe)
    https://www.addthis.com/darkseid/plugins/wprp/v/2.2.6/site/ - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed: The official readme.txt is a good inspiration

addthis-related-posts/bootstrap.php 77% from 13 tests

"WordPress Related Posts Plugin – AddThis" version 2.2.6's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: Please don't use more than 140 characters for the plugin description (currently 142 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("addthis-related-posts.php" instead of "bootstrap.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected27,666 lines of code in 264 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript879221,1958,754
PHP321,1593,3486,286
HTML1095351066,192
PO File27041,0312,671
CSS172802891,648
JSON4001,298
SVG8120392
Markdown31110352
XML28173

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity35.20
▷ Minimum class complexity1.00
▷ Maximum class complexity131.00
Average method complexity4.92
▷ Minimum method complexity1.00
▷ Maximum method complexity64.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes00.00%
Methods262
▷ Static methods4416.79%
▷ Public methods21883.21%
▷ Protected methods3212.21%
▷ Private methods124.58%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants00.00%
▷ Class constants21100.00%
▷ Public constants21100.00%

Plugin size 0% from 2 tests

Image compression 0% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
43 PNG files occupy 0.49MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
frontend/src/images/tool-example-smlsh.png4.23KB2.95KB▼ 30.24%
frontend/src/images/tool-example-tst.png1.90KB2.69KB0.00%
(invalid) frontend/src/images/tool-thumb-sharing-expanding.png41.17KB0.00KB▼ 100.00%
frontend/src/images/tool-example-wnm.png4.60KB2.75KB▼ 40.22%
frontend/src/images/menu-icon.png1.55KB0.68KB▼ 56.53%