78% social-pug-author-box

Code Review | Social Pug: Author Box

WordPress plugin Social Pug: Author Box scored 78% from 54 tests.

About plugin

  • Plugin page: social-pug-author...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.5
  • WordPress version: 5.8.1
  • First release: May 1, 2016
  • Latest release: May 2, 2016
  • Number of updates: 3
  • Update frequency: every 1.3 days
  • Top authors: iova.mihai (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active / 13,230 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼140.08ms] Passed 4 tests

Server-side resources used by Social Pug: Author Box
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.2437.81 ▲13.94
Dashboard /wp-admin3.19 ▲0.1348.87 ▼2.99
Posts /wp-admin/edit.php3.30 ▲0.1941.46 ▼2.74
Add New Post /wp-admin/post-new.php5.54 ▲0.1191.65 ▼553.52
Media Library /wp-admin/upload.php3.13 ▲0.1334.98 ▼1.06
Social Pug Author Box /wp-admin/options-general.php?page=social_pug_author_box3.1032.77

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 18 new files
Database: no new tables, 2 new options
New WordPress options
spab_first_activation
spab_version

Browser metrics Passed 4 tests

Checking browser requirements for Social Pug: Author Box
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,709 ▲11516.25 ▲0.777.35 ▼1.9450.09 ▲1.91
Dashboard /wp-admin3,001 ▲675.90 ▼0.19139.66 ▼10.66133.66 ▲14.77
Posts /wp-admin/edit.php2,764 ▲252.71 ▲0.0175.69 ▲8.31109.44 ▲12.01
Add New Post /wp-admin/post-new.php1,632 ▼5121.22 ▲5.01282.03 ▼116.31110.50 ▼6.56
Media Library /wp-admin/upload.php1,835 ▲285.02 ▲0.01170.34 ▲21.38144.99 ▲19.44
Social Pug Author Box /wp-admin/options-general.php?page=social_pug_author_box1,1622.5067.88140.86

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
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 2 options
    • spab_version
    • spab_first_activation

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-pug-author-box/inc/functions.php:227
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-pug-author-box/inc/class-admin-user-fields.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/social-pug-author-box/inc/class-shortcodes.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/social-pug-author-box/inc/class-admin-settings-page.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/social-pug-author-box/index.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/social-pug-author-box/inc/class-author-box-outputter.php:14

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)
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=social_pug_author_box
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.8.1 1:31592 "jQuery.Deferred exception: $(...).sortable is not a function" "TypeError: $(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/social-pug-author-box/assets/js/dashboard.js?ver=5.8.1:103:25)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/options-general.php?page=social_pug_author_box
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core&ver=5.8.1 1:31702 Uncaught TypeError: $(...).sortable is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: user profile, author profile, author bio, author social icons, follow buttons...

social-pug-author-box/index.php 92% from 13 tests

The main PHP script in "Social Pug: Author Box" version 1.0.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("social-pug-author-box.php" instead of "index.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
Everything looks great! No dangerous files found in this plugin1,362 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
CSS215662826
PHP7290210446
JavaScript1252756
SVG122034

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity8.83
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods27
▷ Static methods13.70%
▷ Public methods27100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.31MB with 0.19MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png89.63KB36.20KB▼ 59.61%
screenshot-2.png127.97KB49.91KB▼ 61.00%
screenshot-1.png95.30KB37.09KB▼ 61.08%