84% add-to-any

Code Review | AddToAny Share Buttons

WordPress plugin AddToAny Share Buttons scored84%from 54 tests.

About plugin

  • Plugin page: add-to-any
  • Plugin version: 1.8.9
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.4
  • WordPress version: 6.3.1
  • First release: Mar 17, 2007
  • Latest release: Oct 27, 2023
  • Number of updates: 742
  • Update frequency: every 8.2 days
  • Top authors: micropat (100%)

Code review

54 tests

User reviews

1070 reviews

Install metrics

400,000+ active /16,374,640 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.50MB] [CPU: ▼0.45ms] Passed 4 tests

A check of server-side resources used by AddToAny Share Buttons
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3742.25 ▲1.31
Dashboard /wp-admin3.85 ▲0.5448.11 ▼1.04
Posts /wp-admin/edit.php3.96 ▲0.6146.94 ▲1.01
Add New Post /wp-admin/post-new.php6.43 ▲0.5482.28 ▼3.09
Media Library /wp-admin/upload.php3.77 ▲0.5443.72 ▲6.39
AddToAny /wp-admin/options-general.php?page=addtoany3.7533.90

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 150 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_a2a_follow_widget
widget_recent-comments
widget_theysaidso_widget
widget_a2a_share_save_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

AddToAny Share Buttons: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,052 ▲29114.24 ▼0.4223.93 ▲22.1846.94 ▲2.21
Dashboard /wp-admin2,240 ▲605.66 ▼0.0185.87 ▼3.9437.68 ▼2.15
Posts /wp-admin/edit.php2,145 ▲452.27 ▲0.2640.73 ▲5.6634.17 ▼3.67
Add New Post /wp-admin/post-new.php6,242 ▲4,71426.06 ▲2.87903.57 ▲211.4865.63 ▲3.87
Media Library /wp-admin/upload.php1,442 ▲424.38 ▲0.19115.78 ▲1.9447.26 ▲0.88
AddToAny /wp-admin/options-general.php?page=addtoany3,1005.58211.8255.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_a2a_follow_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_a2a_share_save_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% 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 take a closer look at the following
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/add-to-any/addtoany.widgets.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-to-any/addtoany.admin.php:76
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/add-to-any/add-to-any.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/add-to-any/addtoany.compat.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% 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:
  • Tags: Please reduce the number of tags, currently 26 tag instead of maximum 10
You can look at the official readme.txt

add-to-any/add-to-any.php Passed 13 tests

This is the main PHP file of "AddToAny Share Buttons" version 1.8.9, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
140 characters long description:
Share buttons for your pages including AddToAny's universal sharing button, Facebook, Mastodon, LinkedIn, Pinterest, WhatsApp and many more.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin4,614 lines of code in 134 files:
LanguageFilesBlank linesComment linesLines of code
PHP64724262,780
PO File86388401,665
SVG11500119
CSS27726
JavaScript22316
XML1008

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.76
Average class complexity12.50
▷ Minimum class complexity7.00
▷ Maximum class complexity18.00
Average method complexity2.92
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods1191.67%
▷ Protected methods00.00%
▷ Private methods18.33%
Functions52
▷ Named functions5096.15%
▷ Anonymous functions23.85%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 compressed PNG files occupy 0.00MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/pinterest_pin_2x.png1.27KB1.27KB0.00%
icons/linkedin_share_2x.png1.65KB1.65KB0.00%
icons/twitter_tweet_2x.png1.17KB1.19KB0.00%
icons/facebook_like_2x.png0.84KB0.85KB0.00%