72% california-state-grants

Code Review | California State Grants

WordPress plugin California State Grants scored72%from 54 tests.

About plugin

  • Plugin page: california-state-...
  • Plugin version: 2.0.8
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Feb 11, 2021
  • Latest release: Nov 8, 2022
  • Number of updates: 20
  • Update frequency: every 31.9 days
  • Top authors: castatelibrary (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /895 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼3.94ms] 75% from 4 tests

This is a short check of server-side resources used by California State Grants
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 875.94ms on /wp-admin/post-new.php?post_type=csl_grant_awards)
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2133.79 ▼6.01
Dashboard /wp-admin3.50 ▲0.2049.37 ▼0.90
Posts /wp-admin/edit.php3.62 ▲0.2646.97 ▼0.05
Add New Post /wp-admin/post-new.php6.22 ▲0.3487.43 ▼8.80
Media Library /wp-admin/upload.php3.42 ▲0.1942.51 ▲8.81
Getting Started /wp-admin/edit.php?post_type=ca_grants&page=welcome3.3932.15
All CA Grants /wp-admin/edit.php?post_type=ca_grants3.4735.68
All Award Uploads /wp-admin/edit.php?post_type=csl_award_uploads3.4736.80
Bulk Upload /wp-admin/edit.php?post_type=csl_award_uploads&page=bulk-upload3.3931.91
Add New /wp-admin/post-new.php?post_type=ca_grants4.122,259.09
Add New /wp-admin/post-new.php?post_type=csl_grant_awards3.74875.94
All Grant Awards /wp-admin/edit.php?post_type=csl_grant_awards3.4435.72

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for California State Grants
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲22113.75 ▼0.621.65 ▼0.1540.74 ▼9.48
Dashboard /wp-admin2,345 ▲1575.52 ▲0.61123.62 ▲23.3642.93 ▼0.26
Posts /wp-admin/edit.php2,241 ▲1523.02 ▲1.0448.85 ▲8.0937.97 ▲2.21
Add New Post /wp-admin/post-new.php1,372 ▼15616.17 ▼2.06313.65 ▼325.1516.00 ▼40.27
Media Library /wp-admin/upload.php1,528 ▲1374.83 ▲0.61114.29 ▲17.3448.60 ▲4.81
Getting Started /wp-admin/edit.php?post_type=ca_grants&page=welcome9332.5630.2724.68
All CA Grants /wp-admin/edit.php?post_type=ca_grants1,2122.8037.5931.71
All Award Uploads /wp-admin/edit.php?post_type=csl_award_uploads1,2042.8239.2628.37
Bulk Upload /wp-admin/edit.php?post_type=csl_award_uploads&page=bulk-upload9252.5931.5724.10
Add New /wp-admin/post-new.php?post_type=ca_grants4,51210.77335.74111.82
Add New /wp-admin/post-new.php?post_type=csl_grant_awards3,5658.91185.6568.35
All Grant Awards /wp-admin/edit.php?post_type=csl_grant_awards1,3312.7939.8928.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • ca_grants_settings
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=csl_grant_awards
    • > Notice in wp-content/plugins/california-state-grants/includes/classes/Meta/Field.php+782
    Undefined index: required
    • > GET request to /wp-admin/edit.php?post_type=csl_grant_awards
    • > Warning in wp-content/plugins/california-state-grants/includes/classes/PostTypes/GrantAwards.php+290
    Use of undefined constant CSL_IS_PORTAL - assumed 'CSL_IS_PORTAL' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/edit.php?post_type=csl_grant_awards
    • > Notice in wp-content/plugins/california-state-grants/includes/classes/PostTypes/GrantAwards.php+294
    Trying to get property 'labels' of non-object
    • > GET request to /wp-admin/edit.php?post_type=csl_grant_awards
    • > Notice in wp-content/plugins/california-state-grants/includes/classes/PostTypes/GrantAwards.php+294
    Trying to get property 'all_items' of non-object
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=csl_grant_awards
    • > Notice in wp-includes/class-walker-category-dropdown.php+76
    Trying to get property 'term_id' of non-object
    • > GET request to /wp-admin/edit.php?post_type=csl_grant_awards
    • > Notice in wp-includes/class-walker-category-dropdown.php+65
    Trying to get property 'name' of non-object
    • > GET request to /wp-admin/edit.php?post_type=csl_grant_awards
    • > User deprecated in wp-includes/functions.php+5737
    Function WP_User_Query was called with an argument that is deprecated since version 5.9.0! who is deprecated. Use capability instead.

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
The following issues need your attention
  • 113× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/california-state-grants/vendor/composer/installers/src/Composer/Installers/MODXEvoInstaller.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/california-state-grants/vendor/composer/installers/src/Composer/Installers/ProcessWireInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/california-state-grants/vendor/composer/installers/src/Composer/Installers/MediaWikiInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/california-state-grants/vendor/composer/installers/src/Composer/Installers/MayaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/california-state-grants/vendor/composer/installers/src/Composer/Installers/PuppetInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/california-state-grants/vendor/composer/installers/src/Composer/Installers/PimcoreInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/california-state-grants/vendor/composer/installers/src/Composer/Installers/FuelInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/california-state-grants/vendor/composer/installers/src/Composer/Installers/KanboardInstaller.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/california-state-grants/includes/classes/REST/GrantAwardsValidation.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/california-state-grants/vendor/composer/installers/src/Composer/Installers/CiviCrmInstaller.php:4

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following browser errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=csl_grant_awards
    • > Network (severe)
    wp-content/plugins/california-state-grants/dist/css/jquery-ui.css?ver=2.0.8 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=csl_grant_awards
    • > Javascript (severe) in unknown
    /wp-content/plugins/california-state-grants/dist/js/admin.js?ver=2.0.8 0:86876 Uncaught TypeError: Cannot read properties of undefined (reading 'dataset')

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: california grants portal, california state agencies, loans, grants, post awards...

california-state-grants/plugin.php 77% from 13 tests

This is the main PHP file of "California State Grants" version 2.0.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("california-state-grants.php" instead of "plugin.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Description: Keep the plugin description shorter than 140 characters (currently 170 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin53,656 lines of code in 242 files:
LanguageFilesBlank linesComment linesLines of code
JSON80041,468
PHP1571,8373,4259,363
JavaScript454604681,849
Markdown91790531
CSS172235153
Sass1300143
YAML3313123
XML21026

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity8.30
▷ Minimum class complexity1.00
▷ Maximum class complexity388.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity67.00
Code structure
Namespaces13
Interfaces0
Traits0
Classes141
▷ Abstract classes21.42%
▷ Concrete classes13998.58%
▷ Final classes00.00%
Methods379
▷ Static methods9023.75%
▷ Public methods32385.22%
▷ Protected methods4110.82%
▷ Private methods153.96%
Functions64
▷ Named functions4570.31%
▷ Anonymous functions1929.69%
Constants24
▷ Global constants1666.67%
▷ Class constants833.33%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/csl-logo-header.png28.25KB11.38KB▼ 59.70%