68% gitswag

Code Review | GitSwag

WordPress plugin GitSwag scored68%from 54 tests.

About plugin

  • Plugin page: gitswag
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.8
  • WordPress version: 6.3.1
  • First release: Dec 30, 2013
  • Latest release: Jun 13, 2014
  • Number of updates: 4
  • Update frequency: every 41.2 days
  • Top authors: kennethrapp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /786 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼1.74MB] [CPU: ▼49.95ms] Passed 4 tests

This is a short check of server-side resources used by GitSwag
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.25 ▼1.228.59 ▼28.35
Dashboard /wp-admin2.27 ▼1.0410.99 ▼44.65
Posts /wp-admin/edit.php2.27 ▼1.0910.33 ▼32.27
Add New Post /wp-admin/post-new.php2.27 ▼3.6210.07 ▼94.54
Media Library /wp-admin/upload.php2.27 ▼0.978.95 ▼25.94
GitSwag /wp-admin/options-general.php?page=gitswag2.2710.05

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for GitSwag
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.51 ▲0.151.73 ▲0.0944.00 ▼0.16
Dashboard /wp-admin2,201 ▲245.55 ▼0.0680.43 ▼4.8839.40 ▼3.64
Posts /wp-admin/edit.php2,103 ▲31.98 ▲0.0339.01 ▼4.4234.92 ▼3.66
Add New Post /wp-admin/post-new.php1,531 ▼123.22 ▲0.24660.28 ▲57.5564.75 ▲14.42
Media Library /wp-admin/upload.php1,400 ▼04.19 ▲0.0298.70 ▼9.3042.72 ▼5.26
GitSwag /wp-admin/options-general.php?page=gitswag8381.9925.0726.86

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
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the css_gitswag handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gitswag
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the css_gitswag handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=gitswag
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the css_gitswag handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=gitswag
    • > 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/options-general.php?page=gitswag
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=gitswag
    • > Notice in wp-content/plugins/gitswag/Admin.php+153
    Trying to get property 'user_login' of non-object
    • > GET request to /wp-admin/options-general.php?page=gitswag
    • > Deprecated in wp-content/plugins/gitswag/Admin.php+294
    stripos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior
    • > GET request to /wp-admin/options-general.php?page=gitswag
    • > Notice in wp-includes/formatting.php+1104
    Array to string conversion

SRP 50% 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
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/gitswag/Preflight.php on line 3
    • > PHP Warning
      include(Parsedown.php): failed to open stream: No such file or directory in wp-content/plugins/gitswag/vendor/erusev/parsedown/tests/Test.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/gitswag/vendor/erusev/parsedown/tests/Test.php:5
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/gitswag/Preflight.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/gitswag/Preflight.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gitswag/Preflight.php on line 3
    • > PHP Warning
      include(): Failed opening 'Parsedown.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/gitswag/vendor/erusev/parsedown/tests/Test.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/gitswag/Preflight.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/gitswag/Preflight.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gitswag/Preflight.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
1 plugin tags: github

gitswag/GitSwag.php 85% from 13 tests

The main file in "GitSwag" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Git Repository: A Git repository was detected inside this plugin
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("gitswag.php" instead of "GitSwag.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin2,074 lines of code in 80 files:
LanguageFilesBlank linesComment linesLines of code
PHP117072151,558
HTML3120179
Markdown32990171
CSS132086
JSON30066
XML1008
YAML1106

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity36.25
▷ Minimum class complexity5.00
▷ Maximum class complexity115.00
Average method complexity7.13
▷ Minimum method complexity1.00
▷ Maximum method complexity79.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods46
▷ Static methods36.52%
▷ Public methods4189.13%
▷ Protected methods00.00%
▷ Private methods510.87%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected