10% addthis

Code Review | WordPress Share Buttons Plugin – AddThis

WordPress plugin WordPress Share Buttons Plugin – AddThis scored 10% from 54 tests.

About plugin

  • Plugin page: addthis
  • Plugin version: 6.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.2
  • WordPress version: 5.9.2
  • First release: Dec 23, 2008
  • Latest release: Jul 10, 2019
  • Number of updates: 473
  • Update frequency: every 8.2 days
  • Top authors: jorbin (29.39%)srijith.v (23.04%)_mjk_ (20.3%)jgrodel (15.86%)addthisjhilts (4.44%)

Code review

54 tests

User reviews

612 reviews

Install metrics

100,000+ active / 5,103,398 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/addthis/backend/AddThisPlugin.php+203
    Undefined index: cms_version

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

Analyzing server-side resources used by WordPress Share Buttons Plugin – AddThis
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.67 ▲1.1561.71 ▲12.74
Dashboard /wp-admin4.61 ▲1.2039.55 ▲5.98
Posts /wp-admin/edit.php4.83 ▲1.1944.42 ▲8.80
Add New Post /wp-admin/post-new.php8.14 ▲1.17103.41 ▼1,191.31
Media Library /wp-admin/upload.php4.55 ▲1.2528.92 ▲0.16
Home /wp-admin/admin.php?page=addthis_registration4.4728.39
Advanced Settings /wp-admin/admin.php?page=addthis_advanced_settings4.4730.68
Share Buttons /wp-admin/admin.php?page=addthis_sharing_buttons4.4729.08

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 321 new files
Database: no new tables, 6 new options
New WordPress options
widget_addthis_tool_by_class_name_widget
widget_addthis_global_options_widget
addthis_shared_settings
addthis_sharing_buttons_settings
addthis_follow_buttons_settings
addthis_recommended_content_settings

Browser metrics Passed 4 tests

This is an overview of browser requirements for WordPress Share Buttons Plugin – AddThis
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,891 ▲16918.15 ▲2.1475.69 ▲70.022.86 ▲0.45
Dashboard /wp-admin2,933 ▲796.21 ▲0.06116.10 ▼31.50188.15 ▲20.57
Posts /wp-admin/edit.php2,730 ▲363.14 ▼0.1168.04 ▲4.94146.01 ▲4.24
Add New Post /wp-admin/post-new.php1,828 ▲16719.58 ▲3.05400.13 ▼4.90199.66 ▲44.93
Media Library /wp-admin/upload.php1,740 ▲395.62 ▲0.07123.65 ▼24.52203.14 ▲20.88
Home /wp-admin/admin.php?page=addthis_registration4,8848.32455.58183.09
Advanced Settings /wp-admin/admin.php?page=addthis_advanced_settings7,77112.29417.32194.58
Share Buttons /wp-admin/admin.php?page=addthis_sharing_buttons3,6219.12258.05213.85

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
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/addthis/backend/AddThisPlugin.php+237
    Undefined index: cms_version
  • This plugin does not fully uninstall, leaving 6 options in the database
    • addthis_sharing_buttons_settings
    • addthis_follow_buttons_settings
    • addthis_shared_settings
    • widget_addthis_global_options_widget
    • widget_addthis_tool_by_class_name_widget
    • addthis_recommended_content_settings

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
  • 29× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis/backend/AddThisAdminUtilities.php:63

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=addthis_registration
    • > Network (severe)
    https://www.addthis.com/darkseid/plugins/wpp/v/6.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

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5, #6 in addthis/assets to your readme.txt
You can look at the official readme.txt

addthis/addthis_social_widget.php 77% from 13 tests

The main file in "WordPress Share Buttons Plugin – AddThis" v. 6.2.6 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Keep the plugin description shorter than 140 characters (currently 362 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("addthis.php" instead of "addthis_social_widget.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 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

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
43 PNG files occupy 0.49MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
frontend/src/images/tool-example-smlrebv.png1.57KB1.65KB0.00%
frontend/src/images/tool-example-msd.png4.39KB2.78KB▼ 36.67%
frontend/src/images/share-tools-icon.png8.01KB3.12KB▼ 61.09%
frontend/src/images/icon-search.png17.97KB0.47KB▼ 97.36%
(invalid) frontend/src/images/tool-thumb-sharing-sidebar.png28.82KB0.00KB▼ 100.00%