94% gitium

Code Review | Gitium

WordPress plugin Gitium scored 94% from 54 tests.

About plugin

  • Plugin page: gitium
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.2.2
  • WordPress version: 5.9.2
  • First release: Jun 22, 2014
  • Latest release: Jul 22, 2019
  • Number of updates: 57
  • Update frequency: every 32.6 days
  • Top authors: PressLabs (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active / 13,869 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.38MB] [CPU: ▼294.63ms] Passed 4 tests

Server-side resources used by Gitium
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.93 ▲0.4161.86 ▲13.20
Dashboard /wp-admin3.77 ▲0.3738.96 ▲4.68
Posts /wp-admin/edit.php4.06 ▲0.4243.80 ▲1.74
Add New Post /wp-admin/post-new.php7.33 ▲0.33101.49 ▼1,179.59
Media Library /wp-admin/upload.php3.71 ▲0.4227.73 ▼5.34

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Gitium
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,789 ▲3515.92 ▼0.185.75 ▼0.602.77 ▲0.04
Dashboard /wp-admin2,917 ▲626.12 ▼0.02123.32 ▼18.98182.44 ▲24.18
Posts /wp-admin/edit.php2,717 ▲233.25 ▲0.0266.68 ▼0.85154.06 ▲4.19
Add New Post /wp-admin/post-new.php1,679 ▼3216.13 ▼5.21405.36 ▼56.18156.91 ▼5.20
Media Library /wp-admin/upload.php1,718 ▲265.58 ▲0.05126.94 ▼20.53210.33 ▲28.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

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
Please fix the following
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Gitium_Menu' not found in wp-content/plugins/gitium/inc/class-gitium-submenu-settings.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Gitium_Menu' not found in wp-content/plugins/gitium/inc/class-gitium-submenu-commits.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_multisite() in wp-content/plugins/gitium/gitium.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/gitium/inc/class-gitium-admin.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gitium/functions.php:420
    • > PHP Fatal error
      Uncaught Error: Class 'Gitium_Menu' not found in wp-content/plugins/gitium/inc/class-gitium-submenu-configure.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Gitium_Menu' not found in wp-content/plugins/gitium/inc/class-gitium-submenu-status.php:18
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/gitium/inc/class-git-wrapper.php on line 661
    • > PHP Fatal error
      Uncaught Error: Class 'Gitium_Menu' not found in wp-content/plugins/gitium/inc/class-gitium-menu-bubble.php:18

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)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: Too many tags (20 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

gitium/gitium.php Passed 13 tests

The primary PHP file in "Gitium" version 1.0.3 is used by WordPress to initiate all plugin functionality
49 characters long description:
Keep all your code on git version control system.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin2,667 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP133773041,980
PO File2198232654
SVG10125
Bourne Shell1008

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity18.60
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity2.54
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods114
▷ Static methods00.00%
▷ Public methods8978.07%
▷ Protected methods32.63%
▷ Private methods2219.30%
Functions45
▷ Named functions45100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/gitium.png0.53KB0.67KB0.00%