10% wtg-portal-manager

Code Review | WTG Portal Manager Beta

WordPress plugin WTG Portal Manager Beta scored 10% from 54 tests.

About plugin

  • Plugin page: wtg-portal-manager
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.0-4.2.2
  • WordPress version: 5.8.1
  • First release: Jan 19, 2015
  • Latest release: Mar 13, 2016
  • Number of updates: 34
  • Update frequency: every 23.2 days
  • Top authors: WebTechGlobal (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 766 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/wtg-portal-manager/classes/class-wtgportalmanager.php+999
    count(): Parameter must be an array or an object that implements Countable

Server metrics [RAM: ▼0.73MB] [CPU: ▼193.69ms] Passed 4 tests

Analyzing server-side resources used by WTG Portal Manager Beta
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.0710.85 ▼25.22
Dashboard /wp-admin2.92 ▼0.1410.35 ▼39.79
Posts /wp-admin/edit.php2.92 ▼0.1912.31 ▼36.29
Add New Post /wp-admin/post-new.php2.92 ▼2.5110.09 ▼673.44
Media Library /wp-admin/upload.php2.92 ▼0.089.76 ▼23.94
Build /wp-admin/admin.php?page=wtgportalmanager_buildpages2.9210.24
Manage /wp-admin/admin.php?page=wtgportalmanager_managepages2.9211.95
Portals Dashboard /wp-admin/admin.php?page=wtgportalmanager2.929.79
Content /wp-admin/admin.php?page=wtgportalmanager_contentsources2.9810.30

Server storage [IO: ▲3.28MB] [DB: ▲0.02MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 96 new files
Database: 2 new tables, 8 new options
New tables
wp_webtechglobal_projects
wp_webtechglobal_projectsmeta
New WordPress options
wtgportalmanager_notifications
wtgportalmanager_settings
wtgportalmanager_formvalidation
wtgportalmanager_installeddate
wtgportalmanager_sidebars
wtgportalmanager_installedversion
wtgportalmanager_is_installed
wtgportalmanager_schedule

Browser metrics Passed 4 tests

This is an overview of browser requirements for WTG Portal Manager Beta
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,815 ▲21915.88 ▲0.279.12 ▼0.0444.11 ▼7.25
Dashboard /wp-admin3,030 ▲965.89 ▼0.07137.96 ▼11.46117.83 ▼1.49
Posts /wp-admin/edit.php2,783 ▲442.70 ▲0.0268.87 ▲2.7692.11 ▲4.04
Add New Post /wp-admin/post-new.php1,700 ▲1718.90 ▲0.51370.50 ▼23.07113.26 ▲5.77
Media Library /wp-admin/upload.php1,854 ▲475.04 ▲0.05169.09 ▼7.21134.15 ▲0.14
Build /wp-admin/admin.php?page=wtgportalmanager_buildpages1,9232.4486.6590.14
Manage /wp-admin/admin.php?page=wtgportalmanager_managepages1,4572.6776.7577.59
Portals Dashboard /wp-admin/admin.php?page=wtgportalmanager7,8164.20132.68138.18
Content /wp-admin/admin.php?page=wtgportalmanager_contentsources1,6892.9178.9792.77

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/wtg-portal-manager/classes/class-wtgportalmanager.php+999
    count(): Parameter must be an array or an object that implements Countable
  • Zombie tables detected upon uninstall: 2 tables
    • wp_webtechglobal_projects
    • wp_webtechglobal_projectsmeta
  • Zombie WordPress options detected upon uninstall: 8 options
    • wtgportalmanager_notifications
    • wtgportalmanager_sidebars
    • wtgportalmanager_formvalidation
    • wtgportalmanager_installedversion
    • wtgportalmanager_is_installed
    • wtgportalmanager_settings
    • wtgportalmanager_installeddate
    • wtgportalmanager_schedule

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 168 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wtgportalmanager_contentsources
    • > Warning in wp-content/plugins/wtg-portal-manager/classes/class-wtgportalmanager.php+999
    count(): Parameter must be an array or an object that implements Countable
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wtgportalmanager_contentsources
    • > User deprecated in wp-includes/functions.php+5211
    get_currentuserinfo is deprecated since version 4.5.0! Use wp_get_current_user() instead.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wtgportalmanager_contentsources
    • > Warning in wp-content/plugins/wtg-portal-manager/classes/class-adminui.php+261
    Use of undefined constant WTGPORTALMANAGER_PROJECT_NAME - assumed 'WTGPORTALMANAGER_PROJECT_NAME' (this will throw an Error in a future version of PHP)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wtgportalmanager_contentsources
    • > Warning in wp-content/plugins/wtg-portal-manager/views/contentsources.php+198
    Use of undefined constant WTGPORTALMANAGER_PROJECT_ID - assumed 'WTGPORTALMANAGER_PROJECT_ID' (this will throw an Error in a future version of PHP)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wtgportalmanager_contentsources
    • > Warning in wp-content/plugins/wtg-portal-manager/classes/class-adminui.php+264
    Use of undefined constant WTGPORTALMANAGER_PROJECT_DESC - assumed 'WTGPORTALMANAGER_PROJECT_DESC' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/admin.php?page=wtgportalmanager_managepages
    • > Warning in wp-content/plugins/wtg-portal-manager/classes/class-wpdb.php+785
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=wtgportalmanager
    • > Notice in wp-content/plugins/wtg-portal-manager/views/main.php+414
    Undefined index: api
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wtgportalmanager
    • > Notice in wp-content/plugins/wtg-portal-manager/views/main.php+414
    Trying to access array offset on value of type null

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 fix the following
  • 37× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/wtg-portal-manager/arrays/themes_array.php
    • > /wp-content/plugins/wtg-portal-manager/classes/class-log.php
    • > /wp-content/plugins/wtg-portal-manager/views/buildpagestable.php
    • > /wp-content/plugins/wtg-portal-manager/classes/class-globalui.php
    • > /wp-content/plugins/wtg-portal-manager/arrays/tableschema_array.php
    • > /wp-content/plugins/wtg-portal-manager/arrays/settings_array.php
    • > /wp-content/plugins/wtg-portal-manager/wtg-portal-manager.php
    • > /wp-content/plugins/wtg-portal-manager/classes/class-wtgportalmanager.php
    • > /wp-content/plugins/wtg-portal-manager/classes/class-view.php
    • > /wp-content/plugins/wtg-portal-manager/views/buildsidebar.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WTGPORTALMANAGER_ADMINUI' not found in wp-content/plugins/wtg-portal-manager/classes/class-forms.php:10

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === wtg-portal-manager === )
You can look at the official readme.txt

wtg-portal-manager/wtg-portal-manager.php 92% from 13 tests

The entry point to "WTG Portal Manager Beta" version 1.0.8 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
There were no executable files found in this plugin11,180 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP473,0328,02110,510
CSS310682638
JavaScript2113932

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity33.17
▷ Minimum class complexity1.00
▷ Maximum class complexity346.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes35.66%
▷ Concrete classes5094.34%
▷ Final classes00.00%
Methods693
▷ Static methods162.31%
▷ Public methods66295.53%
▷ Protected methods162.31%
▷ Private methods152.16%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants53
▷ Global constants5196.23%
▷ Class constants23.77%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
31 PNG files occupy 2.28MB with 2.11MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/video-icon.png29.27KB0.64KB▼ 97.82%
images/info_extra.png147.75KB16.54KB▼ 88.81%
images/logos/phpbb_logo_100x100.png41.16KB3.25KB▼ 92.10%
images/stop_large.png63.48KB5.79KB▼ 90.88%
images/social/Twitter_bird_logo_100x100.png33.76KB2.03KB▼ 93.98%