62% social-footprint

Code Review | Social Footprint

WordPress plugin Social Footprint scored62%from 54 tests.

About plugin

  • Plugin page: social-footprint
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-3.9.1
  • WordPress version: 6.3.1
  • First release: Oct 19, 2015
  • Latest release: Mar 14, 2016
  • Number of updates: 6
  • Update frequency: every 25.0 days
  • Top authors: matthewbarby (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,498 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.80MB] [CPU: ▼34.22ms] Passed 4 tests

A check of server-side resources used by Social Footprint
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1639.73 ▼1.85
Dashboard /wp-admin3.14 ▼0.1728.17 ▼22.11
Posts /wp-admin/edit.php3.14 ▼0.2224.27 ▼25.52
Add New Post /wp-admin/post-new.php3.14 ▼2.7524.22 ▼78.61
Media Library /wp-admin/upload.php3.14 ▼0.0925.18 ▼10.63
About /wp-admin/admin.php?page=authorship-social-counter-help3.1427.01
Settings /wp-admin/admin.php?page=authorship-social-counter-settings3.1424.42
Social Footprint /wp-admin/admin.php?page=authorship-social-counter3.1423.14

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: no new tables, 8 new options
New WordPress options
authorship-social-counter-totals
widget_recent-posts
db_upgraded
theysaidso_admin_options
authorship-social-counter-settings
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Social Footprint
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲8413.60 ▼0.781.82 ▼0.3943.68 ▲2.53
Dashboard /wp-admin2,224 ▲365.84 ▼0.02102.13 ▼9.2665.50 ▲22.46
Posts /wp-admin/edit.php2,122 ▲332.10 ▲0.0735.49 ▼0.2032.98 ▼2.58
Add New Post /wp-admin/post-new.php1,692 ▲15722.71 ▼0.53717.27 ▲61.4949.64 ▼4.84
Media Library /wp-admin/upload.php1,412 ▲244.14 ▼0.06103.88 ▲0.7272.95 ▲28.16
About /wp-admin/admin.php?page=authorship-social-counter-help8702.0223.7330.46
Settings /wp-admin/admin.php?page=authorship-social-counter-settings8792.0228.4426.95
Social Footprint /wp-admin/admin.php?page=authorship-social-counter1,1531.7827.4738.90

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > 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.
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 27 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=authorship-social-counter
    • > 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.

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/social-footprint/views/total_share.php
  • 15× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/social-footprint/includes/wpUrlList.php on line 4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/social-footprint/views/manage_urls_back.php:90
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-footprint/includes/wpUrlList.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/social-footprint/includes/wpUrlList.php on line 4
    • > PHP Notice
      Undefined variable: stats in wp-content/plugins/social-footprint/views/shortcode.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/social-footprint/includes/wpUrlList.php on line 4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/social-footprint/views/help.php:5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/social-footprint/includes/wpUrlList.php on line 4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/social-footprint/includes/wpUrlList.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/social-footprint/includes/wpUrlList.php on line 4

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Importing posts from WordPress into the Social Footprint dashboard.), #2 (Adding custom URLs and selecting which social networks to grab data from.)
The official readme.txt might help

social-footprint/authorship-social-counter.php 92% from 13 tests

The entry point to "Social Footprint" version 1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("social-footprint.php" instead of "authorship-social-counter.php")

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
Success! There were no dangerous files found in this plugin1,854 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP103202061,433
JavaScript39256381
CSS131040

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity51.33
▷ Minimum class complexity18.00
▷ Maximum class complexity108.00
Average method complexity3.22
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods68
▷ Static methods22.94%
▷ Public methods4972.06%
▷ Protected methods1319.12%
▷ Private methods68.82%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
3 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
views/includes/mattLogo.png46.91KB14.74KB▼ 68.57%
includes/rsz_1rsz_1mattlogo.png2.05KB1.36KB▼ 33.57%
assets/icons-sprite.png43.07KB10.26KB▼ 76.17%