78% branded-sharebox

Code Review | Branded Sharebox by Shorten.REST

WordPress plugin Branded Sharebox by Shorten.REST scored78%from 54 tests.

About plugin

  • Plugin page: branded-sharebox
  • Plugin version: 1.5
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4.1
  • WordPress version: 6.3.1
  • First release: May 16, 2020
  • Latest release: Jun 19, 2020
  • Number of updates: 46
  • Update frequency: every 0.7 days
  • Top authors: apilads (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /549 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.04MB] [CPU: ▼7.20ms] Passed 4 tests

An overview of server-side resources used by Branded Sharebox by Shorten.REST
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.44 ▼3.34
Dashboard /wp-admin3.37 ▲0.0251.21 ▼18.48
Posts /wp-admin/edit.php3.42 ▲0.0653.27 ▲4.81
Add New Post /wp-admin/post-new.php5.98 ▲0.0988.50 ▼8.64
Media Library /wp-admin/upload.php3.29 ▲0.0638.23 ▲1.66
Manage URLs /wp-admin/admin.php?page=branded_sharebox_manage_posts3.3133.74
Branded Sharebox /wp-admin/admin.php?page=branded_sharebox3.3537.35
Social Networks /wp-admin/admin.php?page=branded_sharebox_social_networks3.2933.26

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Branded Sharebox by Shorten.REST: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,964 ▲21413.62 ▼0.768.60 ▲6.6739.17 ▼3.83
Dashboard /wp-admin2,250 ▲765.83 ▲0.2289.21 ▼10.6938.52 ▼5.70
Posts /wp-admin/edit.php2,142 ▲422.35 ▲0.3140.37 ▲4.7438.50 ▲1.53
Add New Post /wp-admin/post-new.php1,577 ▲5118.16 ▲0.65684.75 ▼9.8833.81 ▼19.08
Media Library /wp-admin/upload.php1,462 ▲624.37 ▲0.07102.32 ▲6.1546.61 ▲1.95
Manage URLs /wp-admin/admin.php?page=branded_sharebox_manage_posts8981.9727.9436.90
Branded Sharebox /wp-admin/admin.php?page=branded_sharebox1,4802.4550.4229.09
Social Networks /wp-admin/admin.php?page=branded_sharebox_social_networks9662.0929.1649.57

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=branded_sharebox_manage_posts
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/admin.php?page=branded_sharebox_manage_posts
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=branded_sharebox_manage_posts
    • > Notice in wp-content/plugins/branded-sharebox/option-pages/manage-urls-page.php+25
    Undefined variable: returnArr

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
  • 45× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require_once(BRANDED_SHAREBOX_PLUGIN_DIRPEAR/Exception.php): failed to open stream: No such file or directory in wp-content/plugins/branded-sharebox/HTTP/Request2/Exception.php on line 24
    • > PHP Warning
      Use of undefined constant BRANDED_SHAREBOX_PLUGIN_DIR - assumed 'BRANDED_SHAREBOX_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/branded-sharebox/HTTP/Request2/Response.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required 'BRANDED_SHAREBOX_PLUGIN_DIRHTTP/Request2/Adapter.php' (include_path='.:/usr/share/php') in wp-content/plugins/branded-sharebox/HTTP/Request2/Adapter/Mock.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/branded-sharebox/option-pages/main-page.php:4
    • > PHP Warning
      require_once(BRANDED_SHAREBOX_PLUGIN_DIRHTTP/Request2/Adapter.php): failed to open stream: No such file or directory in wp-content/plugins/branded-sharebox/HTTP/Request2/Adapter/Mock.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/branded-sharebox/option-pages/social-networks-page.php:8
    • > PHP Warning
      require_once(BRANDED_SHAREBOX_PLUGIN_DIRHTTP/Request2/Adapter.php): failed to open stream: No such file or directory in wp-content/plugins/branded-sharebox/HTTP/Request2/Adapter/Curl.php on line 24
    • > PHP Fatal error
      require_once(): Failed opening required 'BRANDED_SHAREBOX_PLUGIN_DIRHTTP/Request2/Exception.php' (include_path='.:/usr/share/php') in wp-content/plugins/branded-sharebox/HTTP/Request2/Observer/Log.php on line 25
    • > PHP Warning
      require_once(BRANDED_SHAREBOX_PLUGIN_DIRHTTP/Request2/Exception.php): failed to open stream: No such file or directory in wp-content/plugins/branded-sharebox/HTTP/Request2/SocketWrapper.php on line 22
    • > PHP Warning
      Use of undefined constant BRANDED_SHAREBOX_PLUGIN_DIR - assumed 'BRANDED_SHAREBOX_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/branded-sharebox/HTTP/Request2/Adapter/Socket.php on line 22

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)
No browser issues were found

Optimizations

Plugin configuration 93% 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
9 plugin tags: social media, sharebox, short url, url shortener, share links...

branded-sharebox/index.php 85% from 13 tests

This is the main PHP file of "Branded Sharebox by Shorten.REST" version 1.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("branded-sharebox.php" instead of "index.php")
  • Git Repository: Please remove the Git repository from this plugin

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 detected4,971 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP216313,0524,606
CSS2363288
JavaScript216576
SVG1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity42.53
▷ Minimum class complexity1.00
▷ Maximum class complexity205.00
Average method complexity5.41
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes15.26%
▷ Concrete classes1894.74%
▷ Final classes00.00%
Methods180
▷ Static methods2011.11%
▷ Public methods13373.89%
▷ Protected methods3720.56%
▷ Private methods105.56%
Functions19
▷ Named functions19100.00%
▷ Anonymous functions00.00%
Constants34
▷ Global constants25.88%
▷ Class constants3294.12%
▷ Public constants32100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected