10% 2-click-socialmedia-buttons

Code Review | 2 Click Social Media Buttons

WordPress plugin 2 Click Social Media Buttons scored 10% from 54 tests.

About plugin

  • Plugin page: 2-click-socialmed...
  • Plugin version: 1.6.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.0
  • WordPress version: 5.9.2
  • First release: Sep 5, 2011
  • Latest release: Jul 26, 2014
  • Number of updates: 111
  • Update frequency: every 9.5 days
  • Top authors: ppfeufer (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

3,000+ active / 153,546 total downloads

Benchmarks

Plugin footprint 75% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/2-click-socialmedia-buttons/libs/class-twoclick-backend.php+56
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.01MB] [CPU: ▼301.41ms] Passed 4 tests

An overview of server-side resources used by 2 Click Social Media Buttons
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.0953.68 ▲5.71
Dashboard /wp-admin3.45 ▲0.0433.13 ▼0.03
Posts /wp-admin/edit.php3.67 ▲0.0338.06 ▲0.91
Add New Post /wp-admin/post-new.php6.91 ▼0.0694.84 ▼1,204.46
Media Library /wp-admin/upload.php3.32 ▲0.0323.53 ▼2.07
2-Klick-Buttons /wp-admin/options-general.php?page=twoclick_buttons3.3422.51

Server storage [IO: ▲0.42MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 32 new files
Database: no new tables, 1 new option
New WordPress options
twoclick_buttons_settings

Browser metrics Passed 4 tests

Checking browser requirements for 2 Click Social Media Buttons
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,916 ▲17216.09 ▲0.398.46 ▲2.662.64 ▲0.62
Dashboard /wp-admin2,898 ▲376.19 ▲0.02120.51 ▼13.42174.60 ▲15.38
Posts /wp-admin/edit.php2,694 ▲93.24 ▲0.0063.81 ▲2.50155.15 ▲15.79
Add New Post /wp-admin/post-new.php1,672 ▲1118.56 ▲2.60410.35 ▼22.40198.27 ▲42.36
Media Library /wp-admin/upload.php1,699 ▲15.52 ▼0.01124.37 ▼16.79206.17 ▲20.68
2-Klick-Buttons /wp-admin/options-general.php?page=twoclick_buttons1,6032.6863.30146.47

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=twoclick_buttons
    • > Warning in wp-content/plugins/2-click-socialmedia-buttons/libs/class-twoclick-pages-walker.php+34
    Declaration of Twoclick_Social_Media_Buttons_Pages_Walker::start_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::start_lvl(&$output, $depth = 0, $args = NULL)
    • > GET request to /wp-admin/options-general.php?page=twoclick_buttons
    • > Warning in wp-content/plugins/2-click-socialmedia-buttons/libs/class-twoclick-pages-walker.php+39
    Declaration of Twoclick_Social_Media_Buttons_Pages_Walker::end_lvl(&$output, $depth) should be compatible with Walker_Nav_Menu::end_lvl(&$output, $depth = 0, $args = NULL)
    • > GET request to /wp-admin/options-general.php?page=twoclick_buttons
    • > Warning in wp-content/plugins/2-click-socialmedia-buttons/libs/class-twoclick-pages-walker.php+53
    Declaration of Twoclick_Social_Media_Buttons_Pages_Walker::start_el(&$output, $item, $depth, $args) should be compatible with Walker_Nav_Menu::start_el(&$output, $data_object, $depth = 0, $args = NULL, $current_object_id = 0)

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The SRP test was a success

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 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Buttons unter dem Text.), #2 (Hinweis bei Mouseover.), #3 (Einstellungsmenü der Buttons.)
  • Tags: There are too many tags (12 tag instead of maximum 10)
Please take inspiration from this readme.txt

2-click-socialmedia-buttons/2-click-socialmedia-buttons.php 85% from 13 tests

The main PHP script in "2 Click Social Media Buttons" version 1.6.4 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 170 characters long)
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin3,305 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP103911,0682,397
JavaScript4104101524
PO File1123265270
CSS42340114

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity44.50
▷ Minimum class complexity1.00
▷ Maximum class complexity171.00
Average method complexity6.19
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods67
▷ Static methods00.00%
▷ Public methods2841.79%
▷ Protected methods00.00%
▷ Private methods3958.21%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/settings.png0.64KB0.68KB0.00%
images/sprite.png5.79KB4.44KB▼ 23.42%
images/sprite-de_DE.png6.31KB4.74KB▼ 24.88%
images/socialshareprivacy_on_off.png1.27KB1.29KB0.00%
images/socialshareprivacy_info.png0.16KB0.11KB▼ 31.33%