10% crafty-social-buttons

Code Review | Crafty Social Buttons

WordPress plugin Crafty Social Buttons scored10%from 54 tests.

About plugin

  • Plugin page: crafty-social-but...
  • Plugin version: 1.5.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7
  • WordPress version: 6.3.1
  • First release: Nov 10, 2013
  • Latest release: May 12, 2017
  • Number of updates: 50
  • Update frequency: every 26.0 days
  • Top authors: shen045 (100%)

Code review

54 tests

User reviews

40 reviews

Install metrics

2,000+ active /113,021 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/crafty-social-buttons/crafty-social-buttons.php+47
    Function create_function() is deprecated

Server metrics [RAM: ▼1.53MB] [CPU: ▼44.63ms] Passed 4 tests

A check of server-side resources used by Crafty Social Buttons
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.23 ▼1.236.06 ▼33.37
Dashboard /wp-admin2.56 ▼0.749.86 ▼36.89
Posts /wp-admin/edit.php2.56 ▼0.809.65 ▼34.33
Add New Post /wp-admin/post-new.php2.56 ▼3.3310.11 ▼73.93
Media Library /wp-admin/upload.php2.56 ▼0.6712.67 ▼22.43
Crafty Social Buttons /wp-admin/options-general.php?page=crafty-social-buttons2.5610.26

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 270 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
widget_crafty-social-buttons_widget
theysaidso_admin_options
can_compress_scripts
crafty-social-buttons
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Crafty Social Buttons
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9514.81 ▲0.432.14 ▲0.3343.89 ▼3.57
Dashboard /wp-admin2,220 ▲325.83 ▲0.8098.44 ▼21.6839.76 ▼2.55
Posts /wp-admin/edit.php2,102 ▲132.06 ▼0.1134.73 ▼0.9434.50 ▲1.40
Add New Post /wp-admin/post-new.php1,546 ▲1323.28 ▲0.02666.71 ▲21.5248.63 ▼2.03
Media Library /wp-admin/upload.php1,402 ▲174.29 ▲0.10108.47 ▲9.7047.01 ▲2.04
Crafty Social Buttons /wp-admin/options-general.php?page=crafty-social-buttons1,9672.2847.1337.54

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/crafty-social-buttons/crafty-social-buttons.php+47
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=crafty-social-buttons
    • > Deprecated in wp-content/plugins/crafty-social-buttons/crafty-social-buttons.php+47
    Function create_function() is deprecated

SRP 0% 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
  • 11× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/crafty-social-buttons/help/share-count-tab.php
    • > /wp-content/plugins/crafty-social-buttons/help/about-me-tab.php
    • > /wp-content/plugins/crafty-social-buttons/help/advanced-tab.php
    • > /wp-content/plugins/crafty-social-buttons/help/action-hook-tab.php
    • > /wp-content/plugins/crafty-social-buttons/help/link-tab.php
    • > /wp-content/plugins/crafty-social-buttons/help/share-tab.php
    • > /wp-content/plugins/crafty-social-buttons/help/credits-tab.php
    • > /wp-content/plugins/crafty-social-buttons/help/shortcode-tab.php
    • > /wp-content/plugins/crafty-social-buttons/help/adding-icons-tab.php
    • > /wp-content/plugins/crafty-social-buttons/help/widget-tab.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/crafty-social-buttons/views/admin.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/crafty-social-buttons/views/widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
The official readme.txt might help

crafty-social-buttons/crafty-social-buttons.php 92% from 13 tests

The primary PHP file in "Crafty Social Buttons" version 1.5.8 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin2,540 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP477875452,535
JavaScript3063
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity9.13
▷ Minimum class complexity1.00
▷ Maximum class complexity58.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes00.00%
Methods227
▷ Static methods5624.67%
▷ Public methods21092.51%
▷ Protected methods62.64%
▷ Private methods114.85%
Functions0
▷ Named functions00.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
208 compressed PNG files occupy 0.76MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
buttons/crafty-stitchy-square/instagram.png4.16KB4.04KB▼ 2.79%
buttons/somacro/google.png2.28KB2.17KB▼ 4.83%
buttons/pagepeel/dawanda.png2.72KB2.70KB▼ 0.65%
buttons/crafty-stitchy-round/ebay.png3.39KB3.49KB0.00%
buttons/somacro/youtube.png1.64KB1.63KB▼ 0.66%