10% pbsocialnetworks

Code Review | pbSocialNetworks

WordPress plugin pbSocialNetworks scored 10% from 53 tests.

About plugin

  • Plugin page: pbsocialnetworks
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 5.8.1
  • First release: Mar 8, 2013
  • Latest release: Dec 16, 2016
  • Number of updates: 18
  • Update frequency: every 115.0 days
  • Top authors: PascalBajorat (100%)

Code review

53 tests

User reviews

2 reviews

Install metrics

10+ active / 3,842 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/pbsocialnetworks/pbWidgets.php+53
    Function create_function() is deprecated

Server metrics [RAM: ▼1.88MB] [CPU: ▼305.40ms] Passed 4 tests

An overview of server-side resources used by pbSocialNetworks
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.75 ▼0.979.10 ▼12.94
Dashboard /wp-admin1.77 ▼1.295.24 ▼43.14
Posts /wp-admin/edit.php1.77 ▼1.345.15 ▼31.05
Add New Post /wp-admin/post-new.php1.77 ▼3.665.39 ▼1,114.55
Media Library /wp-admin/upload.php1.77 ▼1.245.54 ▼32.87
Google+ /wp-admin/admin.php?page=pbsocialnetworks/googleplus.php1.775.12
Pinterest /wp-admin/admin.php?page=pbsocialnetworks/pinterest.php1.775.69
Open Graph /wp-admin/admin.php?page=pbsocialnetworks/opengraph.php1.775.78
Twitter /wp-admin/admin.php?page=pbsocialnetworks/twitter.php1.775.40
SocialNetworks /wp-admin/admin.php?page=pbsocialnetworks/pbSocialNetworks.php1.775.40
Stats /wp-admin/admin.php?page=pbsocialnetworks/stats.php1.774.41
Facebook /wp-admin/admin.php?page=pbsocialnetworks/facebook.php1.775.68

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 19 new files
Database: 1 new table, 13 new options
New tables
wp_pbsocialnetworks_stats
New WordPress options
widget_pbsn_lasttweet
widget_pbsn_subscribebtn
pbsn_options_facebook
pbsn_options_googleplus
widget_pbsn_recommendations
widget_pbsn_activityfeed
recovery_mode_email_last_sent
pbsn_options_pinterest
pbSocialNetworksDBversion
pbsn_options_twitter
...

Browser metrics Passed 4 tests

Checking browser requirements for pbSocialNetworks
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,760 ▲15415.85 ▲0.347.52 ▼1.6353.07 ▲2.20
Dashboard /wp-admin3,011 ▲1585.91 ▲0.00137.96 ▼0.89120.55 ▲17.95
Posts /wp-admin/edit.php2,779 ▲732.70 ▲0.0362.11 ▼6.63100.93 ▲0.12
Add New Post /wp-admin/post-new.php2,512 ▲22224.18 ▲4.79371.53 ▼2.74127.00 ▲14.99
Media Library /wp-admin/upload.php1,777 ▲24.94 ▼0.07122.28 ▼34.96132.98 ▲20.67
Google+ /wp-admin/admin.php?page=pbsocialnetworks/googleplus.php1,2532.4953.6181.34
Pinterest /wp-admin/admin.php?page=pbsocialnetworks/pinterest.php1,2212.3759.6077.76
Open Graph /wp-admin/admin.php?page=pbsocialnetworks/opengraph.php1,8612.3757.4389.15
Twitter /wp-admin/admin.php?page=pbsocialnetworks/twitter.php1,2082.3856.3577.34
SocialNetworks /wp-admin/admin.php?page=pbsocialnetworks/pbSocialNetworks.php1,2442.4056.1483.53
Stats /wp-admin/admin.php?page=pbsocialnetworks/stats.php9121.8535.0638.41
Facebook /wp-admin/admin.php?page=pbsocialnetworks/facebook.php1,3182.3858.5788.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/pbsocialnetworks/pbWidgets.php+53
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_pbsn_lasttweet
    • widget_pbsn_likebox
    • widget_pbsn_subscribebtn
    • widget_pbsn_recommendations
    • recovery_mode_email_last_sent
    • widget_pbsn_activityfeed

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 35 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > Deprecated in wp-content/plugins/pbsocialnetworks/pbWidgets.php+257
    Function create_function() is deprecated
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > Notice in wp-content/plugins/pbsocialnetworks/pbSocialNetworks.php+38
    Undefined index: HTTP_REFERER
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in pbsn_likebox is deprecated since version 4.3.0! Use __construct() instead.
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in pbsn_activityfeed is deprecated since version 4.3.0! Use __construct() instead.
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in pbsn_recommendations is deprecated since version 4.3.0! Use __construct() instead.
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in pbsn_subscribebtn is deprecated since version 4.3.0! Use __construct() instead.
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in pbsn_lasttweet is deprecated since version 4.3.0! Use __construct() instead.
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > Warning in wp-content/plugins/pbsocialnetworks/pbOptions.php+967
    Illegal string offset 'status'
  • 28 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > Notice in wp-content/plugins/pbsocialnetworks/pbOptions.php+967
    Uninitialized string offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/opengraph.php
    • > Warning in wp-content/plugins/pbsocialnetworks/pbOptions.php+974
    Illegal string offset 'img'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/twitter.php
    • > Warning in wp-content/plugins/pbsocialnetworks/pbOptions.php+967
    Illegal string offset 'count'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/pbSocialNetworks.php
    • > Warning in wp-content/plugins/pbsocialnetworks/pbOptions.php+967
    Illegal string offset 'statics'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/pbSocialNetworks.php
    • > Warning in wp-content/plugins/pbsocialnetworks/pbOptions.php+967
    Illegal string offset 'css'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/pbSocialNetworks.php
    • > Warning in wp-content/plugins/pbsocialnetworks/pbOptions.php+967
    Illegal string offset 'articles'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/pbSocialNetworks.php
    • > Warning in wp-content/plugins/pbsocialnetworks/pbOptions.php+967
    Illegal string offset 'pages'
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/stats.php
    • > Error in wp-content/plugins/pbsocialnetworks/pbStats.php+68
    Uncaught Error: Call to undefined function mysql_real_escape_string() in /var/www/wordpress/wp-content/plugins/pbsocialnetworks/pbStats.php:68Stack trace:#0 /var/www/wordpress/wp-includes/class-wp-hook.php(303): pbStats->StatsPage()#1 /var/www/wordpress/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()#2 /var/www/wordpress/wp-includes/plugin.php(470): WP_Hook->do_action()#3 /var/www/wordpress/wp-admin/admin.php(259): do_action()#4 {main}thrown
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > Warning in wp-content/plugins/pbsocialnetworks/pbOptions.php+967
    Illegal string offset 'sendbutton'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=pbsocialnetworks/facebook.php
    • > Warning in wp-content/plugins/pbsocialnetworks/pbOptions.php+967
    Illegal string offset 'faces'

SRP 50% 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 items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pbsocialnetworks/pbWidgets.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pbsocialnetworks/pbWidgets.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'pbStats' not found in wp-content/plugins/pbsocialnetworks/pbOptions.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #10 (The Social Buttons: FB like + Send, Tweet and Google +1, Pin it is disabled in this example.) image missing
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
You can take inspiration from this readme.txt

pbsocialnetworks/pbSocialNetworks.php 85% from 13 tests

"pbSocialNetworks" version 1.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pbsocialnetworks.php" instead of "pbSocialNetworks.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 427 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin3,834 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP4336852,066
JavaScript21891661,045
PO File1200222600
HTML115068
CSS210455

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity36.38
▷ Minimum class complexity5.00
▷ Maximum class complexity104.00
Average method complexity5.72
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods60
▷ Static methods00.00%
▷ Public methods60100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon.png1.63KB0.73KB▼ 55.50%
img/icon_36.png3.10KB1.67KB▼ 46.07%