68% social-media-buttons-with-privacy

Code Review | tas2580 Social Media Buttons

WordPress plugin tas2580 Social Media Buttons scored68%from 54 tests.

About plugin

  • Plugin page: social-media-butt...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1.0
  • WordPress version: 6.3.1
  • First release: Dec 8, 2014
  • Latest release: Oct 4, 2015
  • Number of updates: 18
  • Update frequency: every 16.7 days
  • Top authors: tas2580 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,089 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.90MB] [CPU: ▼57.02ms] Passed 4 tests

An overview of server-side resources used by tas2580 Social Media Buttons
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.78 ▼36.63
Dashboard /wp-admin2.11 ▼1.206.32 ▼45.79
Posts /wp-admin/edit.php2.11 ▼1.256.08 ▼51.29
Add New Post /wp-admin/post-new.php2.11 ▼3.786.67 ▼94.38
Media Library /wp-admin/upload.php2.11 ▼1.126.61 ▼29.68
Social Media Buttons /wp-admin/options-general.php?page=social_media_buttons2.116.17

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by tas2580 Social Media Buttons
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.35 ▼0.211.75 ▼0.3639.67 ▼5.86
Dashboard /wp-admin2,201 ▲215.59 ▼0.0688.99 ▼14.4138.54 ▼5.67
Posts /wp-admin/edit.php2,106 ▲62.01 ▲0.0340.87 ▲3.6835.61 ▼4.06
Add New Post /wp-admin/post-new.php1,533 ▲523.00 ▼0.10705.10 ▲29.5052.56 ▲2.43
Media Library /wp-admin/upload.php1,409 ▲94.18 ▼0.0497.64 ▼7.9747.49 ▼2.88
Social Media Buttons /wp-admin/options-general.php?page=social_media_buttons8352.0323.5927.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the social_media handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=social_media_buttons
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the social_media handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=social_media_buttons
    • > Notice in wp-content/plugins/social-media-buttons-with-privacy/plugin.php+60
    Trying to access array offset on value of type bool

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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/social-media-buttons-with-privacy/plugin.php:16

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 93% 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 to be fixed:
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
The official readme.txt is a good inspiration

social-media-buttons-with-privacy/plugin.php 92% from 13 tests

The primary PHP file in "tas2580 Social Media Buttons" version 1.1.2 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("social-media-buttons-with-privacy.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin272 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12338146
CSS10084
PO File114042

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/sprite.png5.63KB3.02KB▼ 46.40%