10% shane-web-guy-portfolio

Code Review | Author URI: http://www.shanewebguy.com/

WordPress plugin Author URI: http://www.shanewebguy.com/scored10%from 54 tests.

About plugin

  • Plugin page: shane-web-guy-por...
  • Plugin version: 2.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Oct 28, 2012
  • Latest release: Dec 18, 2015
  • Number of updates: 115
  • Update frequency: every 10.0 days
  • Top authors: shanewebguy (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

10+ active /5,746 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/shane-web-guy-portfolio/swg-portfolio.php+12
    Use of undefined constant PLUGIN_PATH - assumed 'PLUGIN_PATH' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.95MB] [CPU: ▼54.55ms] Passed 4 tests

This is a short check of server-side resources used by Author URI: http://www.shanewebguy.com/
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.424.55 ▼30.55
Dashboard /wp-admin2.06 ▼1.285.61 ▼53.72
Posts /wp-admin/edit.php2.06 ▼1.295.96 ▼38.00
Add New Post /wp-admin/post-new.php2.06 ▼3.825.39 ▼95.93
Media Library /wp-admin/upload.php2.06 ▼1.175.56 ▼26.42
Settings /wp-admin/edit.php?post_type=swgportfolio&page=swgp_settings2.065.77
SWGP Categories /wp-admin/edit-tags.php?taxonomy=swg_cats&post_type=swgportfolio2.085.69
All Items /wp-admin/edit.php?post_type=swgportfolio2.085.22
Add New /wp-admin/post-new.php?post_type=swgportfolio2.087.01

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 91 new files
Database: no new tables, 23 new options
New WordPress options
widget_recent-comments
swgPreviewTextTitleLabel
swgPreviewTextTitleWeight
widget_theysaidso_widget
swgpBtnTitle
swgPreviewTextFontColor
swgPreviewTextDescriptionLabel
swgPreviewTextTagLabel
swgPreviewTextPadding
swgpBtnFontSize
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Author URI: http://www.shanewebguy.com/
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,965 ▲21913.56 ▼0.795.69 ▲4.0341.55 ▼1.32
Dashboard /wp-admin2,238 ▲495.80 ▲0.86101.84 ▼10.4238.83 ▼4.98
Posts /wp-admin/edit.php2,124 ▲382.14 ▲0.1239.37 ▲4.4535.50 ▲4.56
Add New Post /wp-admin/post-new.php1,543 ▲1517.71 ▼5.41667.75 ▼15.0853.87 ▲5.52
Media Library /wp-admin/upload.php1,423 ▲324.24 ▲0.08100.87 ▲1.4743.55 ▼2.02
Settings /wp-admin/edit.php?post_type=swgportfolio&page=swgp_settings1,3191.9235.2841.80
SWGP Categories /wp-admin/edit-tags.php?taxonomy=swg_cats&post_type=swgportfolio1,5173.2950.1827.38
All Items /wp-admin/edit.php?post_type=swgportfolio1,1311.9630.5228.66
Add New /wp-admin/post-new.php?post_type=swgportfolio2,6407.84171.0067.69

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/shane-web-guy-portfolio/swg-portfolio.php+12
    Use of undefined constant PLUGIN_PATH - assumed 'PLUGIN_PATH' (this will throw an Error in a future version of PHP)
  • This plugin did not uninstall successfully, leaving 23 options in the database
    • swgPreviewTextFontSize
    • db_upgraded
    • swgpreviewBackgroundColor
    • swgpreviewPadding
    • swgPreviewTextTitleAlign
    • swgpBtnTitle
    • swgpBtnFontColor
    • widget_recent-comments
    • theysaidso_admin_options
    • swgpBtnBackgroundColor
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=swgportfolio
    • > Warning in wp-content/plugins/shane-web-guy-portfolio/swg-portfolio.php+12
    Use of undefined constant PLUGIN_PATH - assumed 'PLUGIN_PATH' (this will throw an Error in a future version of PHP)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=swgportfolio
    • > Warning in wp-content/plugins/shane-web-guy-portfolio/swg-portfolio.php+13
    Use of undefined constant PLUGIN_URL - assumed 'PLUGIN_URL' (this will throw an Error in a future version of PHP)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=swg_cats&post_type=swgportfolio
    • > Warning in wp-content/plugins/shane-web-guy-portfolio/lib/Tax-meta-class/Tax-meta-class.php+717
    Illegal string offset 'url'
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=swg_cats&post_type=swgportfolio
    • > Warning in wp-content/plugins/shane-web-guy-portfolio/lib/Tax-meta-class/Tax-meta-class.php+706
    Cannot assign an empty string to a string offset
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=swg_cats&post_type=swgportfolio
    • > Warning in wp-content/plugins/shane-web-guy-portfolio/lib/Tax-meta-class/Tax-meta-class.php+716
    Illegal string offset 'id'
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=swg_cats&post_type=swgportfolio
    • > Notice in wp-content/plugins/shane-web-guy-portfolio/lib/Tax-meta-class/Tax-meta-class.php+717
    Uninitialized string offset: 0
    • > GET request to /wp-admin/post-new.php?post_type=swgportfolio
    • > Notice in wp-content/plugins/shane-web-guy-portfolio/app/models/metabox.php+90
    Undefined index: swg_info_nonce

SRP 0% 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
Please take a closer look at the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/shane-web-guy-portfolio/index.php
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shane-web-guy-portfolio/app/models/css.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/shane-web-guy-portfolio/swg-portfolio.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/shane-web-guy-portfolio/app/init.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shane-web-guy-portfolio/app/models/variables.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shane-web-guy-portfolio/app/views/admin/form.php:7
    • > PHP Warning
      Use of undefined constant PLUGIN_PATH - assumed 'PLUGIN_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/shane-web-guy-portfolio/swg-portfolio.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/shane-web-guy-portfolio/app/controllers/portfolioController.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'SWG_Portfolio' not found in wp-content/plugins/shane-web-guy-portfolio/app/views/admin/adminPage.php:3
    • > PHP Warning
      require(PLUGIN_PATH/lib/Tax-meta-class/Tax-meta-class.php): failed to open stream: No such file or directory in wp-content/plugins/shane-web-guy-portfolio/app/models/settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/shane-web-guy-portfolio/app/models/metabox.php:6

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/edit.php?post_type=swgportfolio&page=swgp_settings
    • > Network (severe)
    wp-content/plugins/swg-portfolio//public/assets/bootstrap/css/bootstrap.min.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=swgportfolio&page=swgp_settings
    • > Network (severe)
    wp-content/plugins/swg-portfolio//public/assets/color-picker/css/bootstrap-colorpicker.min.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=swgportfolio&page=swgp_settings
    • > Network (severe)
    wp-content/plugins/swg-portfolio//public/assets/font-awesome-4.5.0/css/font-awesome.min.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=swgportfolio&page=swgp_settings
    • > Network (severe)
    wp-content/plugins/swg-portfolio//public/css/admin.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=swgportfolio&page=swgp_settings
    • > Network (severe)
    wp-content/plugins/swg-portfolio//public/js/admin.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=swgportfolio&page=swgp_settings
    • > Network (severe)
    wp-content/plugins/swg-portfolio//public/assets/color-picker/js/bootstrap-colorpicker.min.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=swgportfolio&page=swgp_settings
    • > Network (severe)
    wp-content/plugins/swg-portfolio//public/img/portfoliopointer-250x300.jpg - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit-tags.php?taxonomy=swg_cats&post_type=swgportfolio
    • > Deprecation (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 75% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === Author URI: http://www.shanewebguy.com/=== )
  • Contributors: Plugin contributors field is missing
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

shane-web-guy-portfolio/swg-portfolio.php 85% from 13 tests

"Author URI: http://www.shanewebguy.com/" version 2.0.1'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: Please keep the plugin description shorter than 140 characters (currently 308 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("shane-web-guy-portfolio.php" instead of "swg-portfolio.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected12,294 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
CSS181491375,829
JavaScript127094444,068
PHP142807941,673
SVG200656
PO File2182268

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity54.50
▷ Minimum class complexity4.00
▷ Maximum class complexity189.00
Average method complexity3.58
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods83
▷ Static methods00.00%
▷ Public methods83100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
18 PNG files occupy 0.94MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/Tax-meta-class/images/delete-16.png1.74KB0.90KB▼ 48.23%
public/img/arrow-left.png0.38KB0.19KB▼ 49.35%
public/assets/color-picker/img/bootstrap-colorpicker/hue.png2.90KB0.50KB▼ 82.71%
public/assets/color-picker/img/bootstrap-colorpicker/alpha.png3.19KB1.68KB▼ 47.45%
public/assets/color-picker/img/bootstrap-colorpicker/saturation.png8.61KB5.13KB▼ 40.41%