10% addthis-follow

Code Review | WordPress Follow Buttons Plugin – AddThis

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

About plugin

  • Plugin page: addthis-follow
  • Plugin version: 4.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.2.2
  • WordPress version: 5.9.2
  • First release: Jun 29, 2012
  • Latest release: Jul 10, 2019
  • Number of updates: 82
  • Update frequency: every 31.4 days
  • Top authors: srijith.v (28.05%)jgrodel (26.83%)addthisjhilts (25.61%)kirk-at-addthis (6.1%)jorbin (6.1%)

Code review

54 tests

User reviews

35 reviews

Install metrics

10,000+ active / 338,037 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
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/addthis-follow/backend/AddThisPlugin.php+203
    Undefined index: cms_version

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

Analyzing server-side resources used by WordPress Follow Buttons Plugin – AddThis
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.67 ▲1.1566.08 ▲10.75
Dashboard /wp-admin4.61 ▲1.2047.01 ▲8.70
Posts /wp-admin/edit.php4.83 ▲1.1948.56 ▲4.77
Add New Post /wp-admin/post-new.php8.13 ▲1.16114.25 ▼1,165.48
Media Library /wp-admin/upload.php4.55 ▲1.2632.89 ▲2.25
Follow Buttons /wp-admin/admin.php?page=addthis_follow_buttons4.4733.71
Advanced Settings /wp-admin/admin.php?page=addthis_advanced_settings4.4733.08
Home /wp-admin/admin.php?page=addthis_registration4.4732.03

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 321 new files
Database: no new tables, 5 new options
New WordPress options
addthis_recommended_content_settings
widget_addthis_tool_by_class_name_widget
addthis_shared_settings
widget_addthis_global_options_widget
addthis_follow_buttons_settings

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Follow Buttons Plugin – AddThis
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,873 ▲13118.44 ▲2.4478.64 ▲71.613.06 ▲0.59
Dashboard /wp-admin2,919 ▲586.15 ▼0.05118.25 ▼18.60183.53 ▲15.21
Posts /wp-admin/edit.php2,732 ▲413.25 ▲0.0164.61 ▼1.56142.85 ▼0.95
Add New Post /wp-admin/post-new.php1,736 ▲7616.63 ▲0.30424.54 ▲22.58208.08 ▲55.22
Media Library /wp-admin/upload.php1,738 ▲405.74 ▲0.25125.16 ▼22.86213.45 ▲21.40
Follow Buttons /wp-admin/admin.php?page=addthis_follow_buttons16,27613.92749.62167.97
Advanced Settings /wp-admin/admin.php?page=addthis_advanced_settings7,77112.36423.57212.54
Home /wp-admin/admin.php?page=addthis_registration4,8848.25573.70180.80

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
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/addthis-follow/backend/AddThisPlugin.php+237
    Undefined index: cms_version
  • This plugin did not uninstall successfully, leaving 5 options in the database
    • widget_addthis_global_options_widget
    • widget_addthis_tool_by_class_name_widget
    • addthis_follow_buttons_settings
    • addthis_recommended_content_settings
    • addthis_shared_settings

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
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 29× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/addthis-follow/backend/AddThisAdminUtilities.php:63

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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/wpf/v/4.2.6/site/ - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Add descriptions for screenshots #1, #2, #3, #4, #5, #6 in addthis-follow/assets to your readme.txt
You can take inspiration from this readme.txt

addthis-follow/addthis-follow.php 85% from 13 tests

The main PHP file in "WordPress Follow Buttons Plugin – AddThis" ver. 4.2.6 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: The description should be shorter than 140 characters (currently 462 characters long)

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
No dangerous file extensions were 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 short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were 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

PNG files should be compressed to save space and 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-smlre.png1.26KB1.28KB0.00%
(invalid) frontend/src/images/tool-thumb-sharing-image.png27.58KB0.00KB▼ 100.00%
frontend/src/images/icon-search.png17.97KB0.47KB▼ 97.36%
frontend/src/images/audience-targeting-icon.png3.94KB1.59KB▼ 59.72%
frontend/src/images/tool-example-wnm.png4.60KB2.75KB▼ 40.22%