83% add-social-buttons

Code Review | Add Social Buttons

WordPress plugin Add Social Buttons scored83%from 54 tests.

About plugin

  • Plugin page: add-social-buttons
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Sep 23, 2018
  • Latest release: Sep 23, 2018
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: ericwebr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /592 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.39ms] Passed 4 tests

An overview of server-side resources used by Add Social Buttons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1036.63 ▼9.39
Dashboard /wp-admin3.40 ▲0.0943.73 ▼4.14
Posts /wp-admin/edit.php3.45 ▲0.0946.58 ▲2.49
Add New Post /wp-admin/post-new.php5.98 ▲0.0996.22 ▼0.25
Media Library /wp-admin/upload.php3.32 ▲0.0937.23 ▲0.23
All Social Buttonss /wp-admin/edit.php?post_type=addsocialbuttons3.3736.92
Add New /wp-admin/post-new.php?post_type=addsocialbuttons3.3544.44

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Add Social Buttons
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲12213.57 ▼1.181.82 ▲0.0540.43 ▼5.56
Dashboard /wp-admin2,230 ▲425.84 ▼0.0596.32 ▼4.6538.97 ▼5.43
Posts /wp-admin/edit.php2,116 ▲272.02 ▲0.0141.13 ▲6.4638.19 ▲4.22
Add New Post /wp-admin/post-new.php1,570 ▲5618.04 ▲0.42595.01 ▼103.3775.00 ▲17.88
Media Library /wp-admin/upload.php1,415 ▲244.22 ▼0.0298.67 ▼6.1740.96 ▼0.20
All Social Buttonss /wp-admin/edit.php?post_type=addsocialbuttons1,0971.9330.1630.41
Add New /wp-admin/post-new.php?post_type=addsocialbuttons1,6872.5549.6948.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-social-buttons/includes/scripts.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-social-buttons/addsocialbuttons.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (The review edition page)
You can take inspiration from this readme.txt

add-social-buttons/addsocialbuttons.php 85% from 13 tests

The principal PHP file in "Add Social Buttons" v. 1.0.1 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("add-social-buttons.php" instead of "addsocialbuttons.php")
  • 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

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
Everything looks great! No dangerous files found in this plugin411 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP610060389
CSS26622

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
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
12 PNG files occupy 0.04MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/youtube.png2.23KB1.80KB▼ 19.20%
assets/img/behance.png3.09KB2.13KB▼ 31.16%
assets/img/facebook.png2.80KB1.49KB▼ 46.99%
assets/img/yahoo.png3.48KB2.21KB▼ 36.61%
assets/img/flickr.png2.19KB1.60KB▼ 26.90%