84% social-warfare

Code Review | Social Sharing Plugin - Social Warfare

WordPress plugin Social Sharing Plugin - Social Warfare scored84%from 54 tests.

About plugin

  • Plugin page: social-warfare
  • Plugin version: 4.4.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Jul 13, 2016
  • Latest release: Oct 23, 2023
  • Number of updates: 278
  • Update frequency: every 9.6 days
  • Top authors: WarfarePlugins (100%)

Code review

54 tests

User reviews

182 reviews

Install metrics

30,000+ active /1,601,608 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲1.24MB] [CPU: ▼6.72ms] Passed 4 tests

This is a short check of server-side resources used by Social Sharing Plugin - Social Warfare
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /5.13 ▲1.6747.82 ▲6.66
Dashboard /wp-admin4.83 ▲1.4852.50 ▼6.56
Posts /wp-admin/edit.php4.88 ▲1.5355.53 ▲10.17
Add New Post /wp-admin/post-new.php6.33 ▲0.4458.65 ▼37.16
Media Library /wp-admin/upload.php4.75 ▲1.5249.11 ▲14.37

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 164 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_swp_popular_posts_widget
swp_json_cache
social_warfare_dismissed_notices
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
swp_registered_options

Browser metrics Passed 4 tests

An overview of browser requirements for Social Sharing Plugin - Social Warfare
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,238 ▲49213.49 ▼0.8612.56 ▲10.9962.85 ▲17.24
Dashboard /wp-admin2,254 ▲735.65 ▼0.0784.68 ▼10.4146.20 ▲4.03
Posts /wp-admin/edit.php2,189 ▲922.19 ▲0.2137.82 ▲2.7240.75 ▲7.41
Add New Post /wp-admin/post-new.php6,465 ▲4,93929.52 ▲6.47911.02 ▲241.4040.21 ▼24.40
Media Library /wp-admin/upload.php1,456 ▲534.34 ▲0.1496.51 ▼2.7247.90 ▲2.63

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 10 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_swp_popular_posts_widget
    • widget_recent-comments
    • social_warfare_dismissed_notices
    • swp_json_cache
    • widget_theysaidso_widget
    • swp_registered_options
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 31× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SWP_Option' not found in wp-content/plugins/social-warfare/lib/options/SWP_Registration_Tab_Template.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'SWP_Social_Network' not found in wp-content/plugins/social-warfare/lib/social-networks/SWP_Stumble_Upon.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'SWP_Option' not found in wp-content/plugins/social-warfare/lib/options/SWP_Option_Textarea.php:12
    • > PHP Fatal error
      Trait 'SWP_Debug_Trait' not found in wp-content/plugins/social-warfare/lib/options/SWP_Option_Abstract.php on line 14
    • > PHP Fatal error
      Uncaught Error: Class 'SWP_Option' not found in wp-content/plugins/social-warfare/lib/options/SWP_Option_Icons.php:17
    • > PHP Fatal error
      Trait 'SWP_Debug_Trait' not found in wp-content/plugins/social-warfare/lib/utilities/SWP_JSON_Cache_Handler.php on line 18
    • > PHP Fatal error
      Trait 'SWP_Buttons_Panel_Trait' not found in wp-content/plugins/social-warfare/lib/buttons-panel/SWP_Buttons_Panel.php on line 61
    • > PHP Fatal error
      Uncaught Error: Class 'SWP_Option_Abstract' not found in wp-content/plugins/social-warfare/lib/options/SWP_Option.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'SWP_Option_Abstract' not found in wp-content/plugins/social-warfare/lib/options/SWP_Options_Page_Section.php:17
    • > PHP Fatal error
      Trait 'SWP_Debug_Trait' not found in wp-content/plugins/social-warfare/lib/utilities/SWP_Notice_Loader.php on line 18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
You can take inspiration from this readme.txt

social-warfare/social-warfare.php 92% from 13 tests

"Social Sharing Plugin - Social Warfare" version 4.4.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 274 characters long)

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
Success! There were no dangerous files found in this plugin24,912 lines of code in 121 files:
LanguageFilesBlank linesComment linesLines of code
JSON3007,095
PHP642,9928,3266,637
CSS176521035,613
Sass19566653,135
JavaScript166891,2262,348
SVG10167
Markdown18017

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.86
▷ Minimum class complexity1.00
▷ Maximum class complexity76.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits2
Classes62
▷ Abstract classes23.23%
▷ Concrete classes6096.77%
▷ Final classes00.00%
Methods455
▷ Static methods5311.65%
▷ Public methods36981.10%
▷ Protected methods5812.75%
▷ Private methods286.15%
Functions8
▷ Named functions562.50%
▷ Anonymous functions337.50%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.06MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/admin/assets/img/twitter-little-bird-white.png0.33KB0.34KB0.00%
assets/images/admin-options-page/social-warfare-pro-light.png12.86KB7.24KB▼ 43.72%
assets/images/admin-options-page/new_share_counts.png28.70KB11.62KB▼ 59.50%
lib/admin/assets/img/twitter-little-bird.png0.32KB0.33KB0.00%
lib/admin/assets/img/twitter-little-bird-button.png0.28KB0.28KB0.00%