78% social-network-post

Code Review | SocialNetworkPost

WordPress plugin SocialNetworkPost scored78%from 54 tests.

About plugin

  • Plugin page: social-network-post
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.4.2
  • WordPress version: 6.3.1
  • First release: Apr 6, 2016
  • Latest release: Apr 6, 2016
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: prakash.m (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /575 total downloads

Benchmarks

Plugin footprint 83% from 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.03MB] [CPU: ▼13.03ms] Passed 4 tests

This is a short check of server-side resources used by SocialNetworkPost
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0334.30 ▼8.18
Dashboard /wp-admin3.35 ▲0.0145.98 ▼23.11
Posts /wp-admin/edit.php3.40 ▲0.0444.42 ▼7.60
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.62 ▼13.21
Media Library /wp-admin/upload.php3.27 ▲0.0433.85 ▼0.11
SNP Settings /wp-admin/admin.php?page=snetpost_options3.3831.99
Get Tokens /wp-admin/admin.php?page=snpost_gettoken3.3831.88

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 85 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
recovery_mode_email_last_sent
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

SocialNetworkPost: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲10613.34 ▼1.041.92 ▼0.2239.02 ▼3.30
Dashboard /wp-admin2,236 ▲514.86 ▼1.0299.50 ▼21.3739.97 ▼4.05
Posts /wp-admin/edit.php2,116 ▲272.02 ▲0.0239.44 ▲4.6431.52 ▼4.06
Add New Post /wp-admin/post-new.php1,535 ▲2117.67 ▲0.20632.81 ▼75.8848.16 ▼2.91
Media Library /wp-admin/upload.php1,415 ▲244.20 ▼0.0395.87 ▼5.8540.97 ▼6.91
SNP Settings /wp-admin/admin.php?page=snetpost_options7161.147.3823.00
Get Tokens /wp-admin/admin.php?page=snpost_gettoken7011.146.6416.33

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 7 options
    • recovery_mode_email_last_sent
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=snpost_gettoken
    • > Notice in wp-content/plugins/social-network-post/snetpost.php+105
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=snetpost_options
    • > Error in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/Facebook.php+139
    Uncaught Facebook\Exceptions\FacebookSDKException: Required "app_id" key not supplied in config and could not find fallback environment variable "FACEBOOK_APP_ID" in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/Facebook.php:139
    Stack trace:
    #0 wp-content/plugins/social-network-post/snetpost.php(220): Facebook\Facebook->__construct()
    #1 wp-admin/includes/template.php(1771): Snetpost->plugin_section_text()
    #2 wp-content/plugins/social-network-post/snetpost.php(277): do_settings_sections()
    #3 wp-includes/class-wp-hook.php(310): Snetpost->snetpost_options_page()
    #4 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #5 wp-includes/plugin.php(517): WP_Hook->do_action()
    #6 wp-admin/admin.php(259): do_action()
    #7 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=snpost_gettoken
    • > Error in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/Facebook.php+139
    Uncaught Facebook\Exceptions\FacebookSDKException: Required "app_id" key not supplied in config and could not find fallback environment variable "FACEBOOK_APP_ID" in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/Facebook.php:139
    Stack trace:
    #0 wp-content/plugins/social-network-post/snetpost.php(106): Facebook\Facebook->__construct()
    #1 wp-includes/class-wp-hook.php(310): Snetpost->addscreen_snetpost()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown

SRP 50% 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 fix the following
  • 42× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/GraphNodes/GraphGroup.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/GraphNodes/GraphAlbum.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/GraphNodes/GraphObject.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/GraphNodes/GraphApplication.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Exceptions\\FacebookSDKException' not found in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/Exceptions/FacebookOtherException.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Exceptions\\FacebookSDKException' not found in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/Exceptions/FacebookResponseException.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\HttpClients\\FacebookHttpClientInterface' not found in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/HttpClients/FacebookCurlHttpClient.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-network-post/snetpost.php:65
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Exceptions\\FacebookSDKException' not found in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/Exceptions/FacebookAuthenticationException.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\Collection' not found in wp-content/plugins/social-network-post/vendor/facebook/php-sdk-v4/src/Facebook/GraphNodes/GraphEdge.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
9 plugin tags: comments, social network post, friends, publish facebook, snp...

social-network-post/snetpost.php 77% from 13 tests

"SocialNetworkPost" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 157 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("social-network-post.php" instead of "snetpost.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected5,219 lines of code in 82 files:
LanguageFilesBlank linesComment linesLines of code
PHP801,1615,6075,119
JSON200100

PHP code Passed 2 tests

An overview 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.29
Average class complexity5.93
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity1.71
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces12
Interfaces5
Traits1
Classes69
▷ Abstract classes11.45%
▷ Concrete classes6898.55%
▷ Final classes00.00%
Methods528
▷ Static methods203.79%
▷ Public methods48391.48%
▷ Protected methods254.73%
▷ Private methods203.79%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants23
▷ Global constants00.00%
▷ Class constants23100.00%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin