73% kw-essential-share-buttons

Code Review | Kw Essential share buttons

WordPress plugin Kw Essential share buttons scored73%from 54 tests.

About plugin

  • Plugin page: kw-essential-shar...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4.1
  • WordPress version: 6.3.1
  • First release: Jun 10, 2011
  • Latest release: Jul 27, 2012
  • Number of updates: 54
  • Update frequency: every 7.7 days
  • Top authors: KwarK (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,406 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.96MB] [CPU: ▼55.01ms] Passed 4 tests

An overview of server-side resources used by Kw Essential share buttons
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.444.34 ▼39.48
Dashboard /wp-admin2.08 ▼1.266.77 ▼45.76
Posts /wp-admin/edit.php2.09 ▼1.316.06 ▼39.99
Add New Post /wp-admin/post-new.php2.08 ▼3.845.49 ▼94.81
Media Library /wp-admin/upload.php2.08 ▼1.195.40 ▼30.83

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Kw Essential share buttons
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲3214.37 ▲0.011.66 ▼0.6544.69 ▼0.29
Dashboard /wp-admin2,198 ▲215.59 ▲0.0197.27 ▼4.3656.76 ▲10.03
Posts /wp-admin/edit.php2,100 ▲31.95 ▼0.0233.79 ▼2.1134.78 ▼0.08
Add New Post /wp-admin/post-new.php1,526 ▼223.19 ▲0.35652.98 ▼45.5355.48 ▼12.09
Media Library /wp-admin/upload.php1,394 ▼64.23 ▲0.04109.99 ▼0.2444.58 ▼1.22

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 validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_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 kw_button_share handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means 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
Please fix the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/kw-essential-share-buttons/kw-primo-share-button.php:34
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/kw-essential-share-buttons/kw-primo-share-button.php on line 32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (No screen)
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
You can look at the official readme.txt

kw-essential-share-buttons/kw-primo-share-button.php 85% from 13 tests

The principal PHP file in "Kw Essential share buttons" v. 1.2 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 230 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("kw-essential-share-buttons.php" instead of "kw-primo-share-button.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin56 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP1152449
CSS2027

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/blt8.png0.76KB0.76KB0.26%
images/twitter.png0.79KB0.99KB0.00%
images/google.png0.75KB0.68KB▼ 9.00%
images/facebook.png0.82KB1.05KB0.00%
images/linkedin.png0.78KB0.83KB0.00%