84% google-web-fonts-customizer-gwfc

Code Review | Google Web Fonts Customizer (GWFC)

WordPress plugin Google Web Fonts Customizer (GWFC) scored84%from 54 tests.

About plugin

  • Plugin page: google-web-fonts-...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-3.9.1
  • WordPress version: 6.3.1
  • First release: Mar 9, 2014
  • Latest release: Jul 15, 2014
  • Number of updates: 20
  • Update frequency: every 6.4 days
  • Top authors: chanif.alfath (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

1,000+ active /39,351 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.04ms] Passed 4 tests

Server-side resources used by Google Web Fonts Customizer (GWFC)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.04 ▼7.65
Dashboard /wp-admin3.34 ▲0.0444.34 ▼6.55
Posts /wp-admin/edit.php3.39 ▲0.0447.90 ▲3.29
Add New Post /wp-admin/post-new.php5.92 ▲0.0482.52 ▼2.80
Media Library /wp-admin/upload.php3.27 ▲0.0433.46 ▼3.15

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Google Web Fonts Customizer (GWFC): an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲7714.47 ▼0.181.74 ▼0.4440.46 ▼6.88
Dashboard /wp-admin2,218 ▲304.85 ▼0.01102.73 ▼13.9138.70 ▼9.24
Posts /wp-admin/edit.php2,101 ▲122.05 ▲0.0539.37 ▲4.5336.13 ▼2.12
Add New Post /wp-admin/post-new.php1,552 ▲3318.46 ▼4.65677.20 ▲7.5254.57 ▼2.71
Media Library /wp-admin/upload.php1,400 ▲94.24 ▲0.0896.37 ▼6.6740.50 ▼10.24

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-web-fonts-customizer-gwfc/output.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-web-fonts-customizer-gwfc/register.php:170
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-web-fonts-customizer-gwfc/gwfc.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/google-web-fonts-customizer-gwfc/controls.php:46

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
10 plugin tags: fonts, google fonts wordpress, google webfonts, wordpress google fonts plugin, theme fonts plugin...

google-web-fonts-customizer-gwfc/gwfc.php 85% from 13 tests

The main PHP script in "Google Web Fonts Customizer (GWFC)" version 1.0.2 is automatically included on every request by WordPress
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 235 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("google-web-fonts-customizer-gwfc.php" instead of "gwfc.php")

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
There were no executable files found in this plugin12,398 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JSON10011,356
JavaScript2623112822
PHP49497196
CSS17624

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected