10% wp-social-share

Code Review | WP Social Share

WordPress plugin WP Social Share scored 10% from 54 tests.

About plugin

  • Plugin page: wp-social-share
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4.2
  • WordPress version: 5.8.1
  • First release: Dec 5, 2012
  • Latest release: Dec 14, 2012
  • Number of updates: 5
  • Update frequency: every 1.8 days
  • Top authors: sharpcoders (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active / 26,808 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
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/wp-social-share/wp-social-share.php+19
    Use of undefined constant WPSocialShare - assumed 'WPSocialShare' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.81MB] [CPU: ▼198.07ms] Passed 4 tests

Analyzing server-side resources used by WP Social Share
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.82 ▼0.904.28 ▼15.29
Dashboard /wp-admin1.83 ▼1.226.36 ▼46.99
Posts /wp-admin/edit.php1.84 ▼1.2710.19 ▼45.28
Add New Post /wp-admin/post-new.php1.83 ▼3.607.74 ▼668.35
Media Library /wp-admin/upload.php1.83 ▼1.176.93 ▼31.65

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 1 new option
New WordPress options
wp_social_share_options

Browser metrics Passed 4 tests

WP Social Share: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,946 ▲35019.81 ▲3.87112.73 ▲104.5371.35 ▲27.64
Dashboard /wp-admin2,975 ▲445.88 ▼0.05168.09 ▲20.42129.02 ▲20.07
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0175.48 ▼0.01107.84 ▲13.97
Add New Post /wp-admin/post-new.php1,517 ▼2,17018.96 ▲1.07392.15 ▼148.23121.35 ▲5.31
Media Library /wp-admin/upload.php1,812 ▲55.01 ▼0.01157.80 ▲5.47130.12 ▲2.18
WP Social Share /wp-admin/wp-social-share.php260.900.0810.02

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
These items require your attention
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/wp-social-share/wp-social-share.php+19
    Use of undefined constant WPSocialShare - assumed 'WPSocialShare' (this will throw an Error in a future version of PHP)
  • This plugin does not fully uninstall, leaving 1 option in the database
    • wp_social_share_options

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-social-share/wp-social-share.php
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Notice
      Undefined variable: action_url in wp-content/plugins/wp-social-share/wp-social-share-admin-options.php on line 70
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wp-social-share/wp-social-share-admin-options.php:72

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/wp-social-share.php
    • > Network (severe)
    wp-admin/wp-social-share.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Admin Panel Setting), #2 (WP Social Share Buttons at Category Page), #3 (WP Social Share Buttons at Post)
You can take inspiration from this readme.txt

wp-social-share/wp-social-share.php Passed 13 tests

The main PHP script in "WP Social Share" version 1.1 is automatically included on every request by WordPress
68 characters long description:
Add Social Networks Share Button at Home, Category and Single Posts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected565 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP23212565

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.66
Average class complexity46.00
▷ Minimum class complexity46.00
▷ Maximum class complexity46.00
Average method complexity6.62
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.30MB with 0.16MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png33.79KB13.83KB▼ 59.06%
screenshot-1.png172.19KB69.19KB▼ 59.82%
screenshot-2.png97.99KB52.71KB▼ 46.20%