88% gp-social-share-svg

Code Review | GP Social Share

WordPress plugin GP Social Share scored 88% from 54 tests.

About plugin

  • Plugin page: gp-social-share-svg
  • Plugin version: 2.2
  • PHP compatiblity: 7.2.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.7.2
  • WordPress version: 5.8.1
  • First release: Jun 14, 2018
  • Latest release: May 24, 2021
  • Number of updates: 36
  • Update frequency: every 30.7 days
  • Top authors: westcoastdigital (100%)

Code review

54 tests

User reviews

14 reviews

Install metrics

1,000+ active / 10,924 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼148.29ms] Passed 4 tests

A check of server-side resources used by GP Social Share
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.99 ▲0.2740.11 ▲12.81
Dashboard /wp-admin3.22 ▲0.1646.97 ▼2.09
Posts /wp-admin/edit.php3.33 ▲0.2146.92 ▼13.32
Add New Post /wp-admin/post-new.php5.12 ▼0.3178.27 ▼573.77
Media Library /wp-admin/upload.php3.16 ▲0.1636.55 ▼3.99
GP Social Settings /wp-admin/themes.php?page=gp-social-options-page3.1436.49

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 288 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for GP Social Share
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,740 ▲10316.30 ▲0.409.88 ▼0.9754.79 ▲7.24
Dashboard /wp-admin3,005 ▲747.04 ▲1.09149.10 ▼22.99113.58 ▼27.61
Posts /wp-admin/edit.php2,782 ▲432.84 ▲0.1574.30 ▲6.46111.85 ▲12.27
Add New Post /wp-admin/post-new.php1,985 ▲40415.74 ▼5.72414.49 ▼10.29145.24 ▼51.33
Media Library /wp-admin/upload.php1,847 ▲375.55 ▲0.50152.86 ▼36.65127.27 ▲11.05
GP Social Settings /wp-admin/themes.php?page=gp-social-options-page3,9324.41142.9683.00

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% 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 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
Almost there! Just fix the following items
  • 9× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/gp-social-share-svg/inc/class-social-share.php
    • > /wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/templates/image-advanced.php
    • > /wp-content/plugins/gp-social-share-svg/inc/gp-social-settings.php
    • > /wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/templates/upload.php
    • > /wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/templates/audio.php
    • > /wp-content/plugins/gp-social-share-svg/inc/css/gp-social-share-css.php
    • > /wp-content/plugins/gp-social-share-svg/inc/gp-social-woo.php
    • > /wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/templates/video.php
    • > /wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/templates/media.php
  • 68× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_Field' not found in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/fields/file-input.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/fields/input.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Choice_Field' not found in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/fields/select.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/fields/file.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Taxonomy_Field' not found in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/fields/taxonomy-advanced.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Text_Field' not found in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/fields/fieldset-text.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/about/sections/welcome.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Text_Field' not found in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/fields/color.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Media_Field' not found in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/fields/file-upload.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Image_Advanced_Field' not found in wp-content/plugins/gp-social-share-svg/inc/metabox/meta-box/inc/fields/single-image.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: svg, share, social

gp-social-share-svg/gp-social-share.php 77% from 13 tests

"GP Social Share" version 2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gp-social-share-svg.php" instead of "gp-social-share.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin15,238 lines of code in 255 files:
LanguageFilesBlank linesComment linesLines of code
PHP1041,8656,0098,854
JavaScript945855272,462
CSS412301312,438
PO File145346001,471
Markdown1708
SVG1005

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity11.71
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity2.73
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes91
▷ Abstract classes66.59%
▷ Concrete classes8593.41%
▷ Final classes00.00%
Methods572
▷ Static methods30753.67%
▷ Public methods49786.89%
▷ Protected methods5910.31%
▷ Private methods162.80%
Functions70
▷ Named functions6694.29%
▷ Anonymous functions45.71%
Constants10
▷ Global constants770.00%
▷ Class constants330.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
14 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/metabox/meta-box/img/jqueryui/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
inc/metabox/meta-box/img/jqueryui/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
inc/metabox/meta-box/img/jqueryui/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
inc/metabox/meta-box/img/jqueryui/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
inc/metabox/meta-box/img/jqueryui/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%