77% smart-social-pack

Code Review | social share

WordPress plugin social share scored77%from 54 tests.

About plugin

  • Plugin page: smart-social-pack
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 23, 2016
  • Latest release: Jul 21, 2019
  • Number of updates: 58
  • Update frequency: every 18.3 days
  • Top authors: quazisazzad (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,692 total downloads

Benchmarks

Plugin footprint 83% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.22MB] [CPU: ▼7.95ms] Passed 4 tests

Analyzing server-side resources used by social share
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.2146.61 ▲2.64
Dashboard /wp-admin3.85 ▲0.2252.72 ▼13.56
Posts /wp-admin/edit.php3.90 ▲0.2255.69 ▲4.52
Add New Post /wp-admin/post-new.php6.39 ▲0.2491.39 ▼22.00
Media Library /wp-admin/upload.php3.71 ▲0.2241.23 ▲1.12
Post Share Settings /wp-admin/options-general.php?page=post_share3.6837.81

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 40 new options
New WordPress options
smart_fb_share
smart_fb_share_buttom
widget_social_link
twitter_bacground
gp_hover
enable_eml
theysaidso_admin_options
gp_bacground
twitter_hover
ln_bacground
...

Browser metrics Passed 4 tests

social share: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲10814.03 ▼0.2738.43 ▲36.5236.86 ▼7.80
Dashboard /wp-admin2,215 ▲355.73 ▲0.0587.38 ▼2.6037.57 ▼5.43
Posts /wp-admin/edit.php2,128 ▲282.34 ▲0.3142.02 ▲4.0333.82 ▼3.05
Add New Post /wp-admin/post-new.php1,547 ▲2123.46 ▲5.80616.41 ▼75.7333.38 ▼26.17
Media Library /wp-admin/upload.php1,426 ▲264.41 ▲0.17107.17 ▲3.1846.57 ▼1.50
Post Share Settings /wp-admin/options-general.php?page=post_share3,4123.87122.0240.41

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_smart_fb_page_like
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_social_link
    • can_compress_scripts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/smart-social-pack/style/style.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-social-pack/includes/share_setting.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/smart-social-pack/includes/smart-fb-page-class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-social-pack/includes/smart-fb-script.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/smart-social-pack/includes/share_content.php:80
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/smart-social-pack/includes/social_link_class.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #4 (/assets/screenshot-6.png), #5 (/assets/screenshot-7.png)
  • Tags: Please delete some tags, you are using 13 tag instead of maximum 10
Please take inspiration from this readme.txt

smart-social-pack/smart-social-plugn.php 85% from 13 tests

This is the main PHP file of "social share" version 1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 350 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("smart-social-pack.php" instead of "smart-social-plugn.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,080 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP7213491,069
JavaScript33011

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity30.00
▷ Minimum class complexity29.00
▷ Maximum class complexity31.00
Average method complexity6.27
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.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
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/facebook.png5.04KB2.83KB▼ 43.84%
img/twitter.png5.52KB2.72KB▼ 50.65%
img/google.png6.25KB3.14KB▼ 49.83%
img/linkedin.png5.02KB2.85KB▼ 43.27%