10% share-rail

Code Review | Share Rail

WordPress plugin Share Rail scored10%from 54 tests.

About plugin

  • Plugin page: share-rail
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.3-3.3
  • WordPress version: 6.3.1
  • First release: Aug 16, 2011
  • Latest release: Jun 12, 2012
  • Number of updates: 40
  • Update frequency: every 7.6 days
  • Top authors: Bloafer (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /6,840 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/share-rail/share-rail.php+77
    Undefined variable: plugins

Server metrics [RAM: ▼1.96MB] [CPU: ▼49.64ms] Passed 4 tests

A check of server-side resources used by Share Rail
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.447.04 ▼32.14
Dashboard /wp-admin2.05 ▼1.269.12 ▼37.91
Posts /wp-admin/edit.php2.05 ▼1.319.95 ▼39.82
Add New Post /wp-admin/post-new.php2.05 ▼3.8410.16 ▼88.67
Media Library /wp-admin/upload.php2.05 ▼1.1811.08 ▼27.44
Sort /wp-admin/admin.php?page=share-rail/incs/settings-sort.php2.0510.45
Share Rail /wp-admin/admin.php?page=share-rail/incs/settings.php2.059.97

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Share Rail
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲18316.85 ▲2.485.21 ▲3.5247.82 ▲3.24
Dashboard /wp-admin2,273 ▲967.64 ▲1.99238.61 ▲138.9588.71 ▲45.20
Posts /wp-admin/edit.php2,202 ▲994.59 ▲2.5989.47 ▲46.3554.88 ▲17.69
Add New Post /wp-admin/post-new.php6,383 ▲4,85724.32 ▲1.131,048.87 ▲345.0941.75 ▼8.64
Media Library /wp-admin/upload.php1,495 ▲955.99 ▲1.75144.79 ▲29.2596.88 ▲48.45
Sort /wp-admin/admin.php?page=share-rail/incs/settings-sort.php9214.2984.4326.34
Share Rail /wp-admin/admin.php?page=share-rail/incs/settings.php1,6858.42185.8367.67

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/share-rail/share-rail.php+77
    Undefined variable: plugins
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Notice in wp-content/plugins/share-rail/share-rail.php+77
    Undefined variable: plugins
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Warning in wp-content/plugins/share-rail/share-rail.php+77
    Invalid argument supplied for foreach()
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Deprecated in wp-content/plugins/share-rail/share-rail.php+187
    Non-static method shareRail_Twitter::enqueue_scripts() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Deprecated in wp-content/plugins/share-rail/share-rail.php+188
    Non-static method shareRail_Facebook::enqueue_scripts() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Deprecated in wp-content/plugins/share-rail/share-rail.php+189
    Non-static method shareRail_Linkedin::enqueue_scripts() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Deprecated in wp-content/plugins/share-rail/share-rail.php+190
    Non-static method shareRail_Google::enqueue_scripts() should not be called statically
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Deprecated in wp-content/plugins/share-rail/incs/settings.php+132
    Non-static method shareRail_Google::footerScript() should not be called statically
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Deprecated in wp-content/plugins/share-rail/incs/settings.php+146
    Non-static method shareRail_Twitter::rail() should not be called statically
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Deprecated in wp-content/plugins/share-rail/incs/settings.php+147
    Non-static method shareRail_Google::rail() should not be called statically
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Deprecated in wp-content/plugins/share-rail/incs/settings.php+148
    Non-static method shareRail_Facebook::rail() should not be called statically
    • > GET request to /wp-admin/admin.php?page=share-rail/incs/settings.php
    • > Deprecated in wp-content/plugins/share-rail/incs/settings.php+149
    Non-static method shareRail_Linkedin::rail() should not be called statically

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 take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/share-rail/share-rail.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/share-rail/incs/settings-sort.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/share-rail/incs/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/share-rail/incs/head.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/share-rail/incs/rail.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/share-rail/incs/footer.php:2

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/admin.php?page=share-rail/incs/settings.php
    • > Other (severe) in unknown
    chrome-error://chromewebdata/ - Refused to display 'https://developers.google.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (Floating share in its default position), #2 (When the user scrolls the share rail stays in view)
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

share-rail/share-rail.php Passed 13 tests

The main PHP file in "Share Rail" ver. 2.2 adds more information about the plugin and also serves as the entry point for this plugin
65 characters long description:
Use this plugin to apply floating shares to your posts and pages.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin1,229 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP153324688
CSS138156541

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity5.80
▷ Minimum class complexity1.00
▷ Maximum class complexity35.00
Average method complexity2.02
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods47
▷ Static methods00.00%
▷ Public methods4595.74%
▷ Protected methods00.00%
▷ Private methods24.26%
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

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png11.13KB6.05KB▼ 45.68%
admin/ui/images/bg_fallback.png3.63KB0.30KB▼ 91.72%
img/share.png0.67KB0.79KB0.00%
admin/ui/images/icon_sprite.png3.14KB2.30KB▼ 26.70%
screenshot-2.png7.46KB4.54KB▼ 39.18%