84% cache-google-font

Code Review | Cache Google Web Font

WordPress plugin Cache Google Web Font scored84%from 54 tests.

About plugin

  • Plugin page: cache-google-font
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.0.0
  • WordPress version: 6.3.1
  • First release: Sep 16, 2014
  • Latest release: Sep 20, 2014
  • Number of updates: 12
  • Update frequency: every 0.4 days
  • Top authors: caijiamx (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,271 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.71ms] Passed 4 tests

A check of server-side resources used by Cache Google Web Font
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0537.63 ▲0.02
Dashboard /wp-admin3.37 ▲0.0245.62 ▼13.59
Posts /wp-admin/edit.php3.48 ▲0.1248.52 ▲2.22
Add New Post /wp-admin/post-new.php5.95 ▲0.0684.49 ▼18.51
Media Library /wp-admin/upload.php3.29 ▲0.0635.47 ▲1.25
Cache Google Font /wp-admin/options-general.php?page=cache_google_font_settings3.2531.13

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Cache Google Web Font
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.17 ▼1.071.84 ▲0.1940.30 ▼3.30
Dashboard /wp-admin2,204 ▲155.81 ▲0.89105.94 ▼7.2341.75 ▼5.90
Posts /wp-admin/edit.php2,093 ▲41.97 ▼0.0439.51 ▼0.0836.04 ▲3.14
Add New Post /wp-admin/post-new.php1,536 ▲823.33 ▲4.95672.25 ▲55.0363.36 ▲2.74
Media Library /wp-admin/upload.php1,386 ▼24.26 ▲0.0497.44 ▼8.0644.12 ▲1.67
Cache Google Font /wp-admin/options-general.php?page=cache_google_font_settings8342.1623.7957.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cache-google-font/cache_fonts.php:33

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 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: web font, google, cache

cache-google-font/cache_fonts.php 92% from 13 tests

"Cache Google Web Font" version 1.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cache-google-font.php" instead of "cache_fonts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected303 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP12216303

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 issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity32.00
▷ Minimum class complexity32.00
▷ Maximum class complexity32.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin