10% advanced-font-changer

Code Review | Advanced Font Changer

WordPress plugin Advanced Font Changer scored 10% from 54 tests.

About plugin

  • Plugin page: advanced-font-cha...
  • Plugin version: 1.5.5
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Jun 2, 2015
  • Latest release: Nov 15, 2015
  • Number of updates: 29
  • Update frequency: every 5.7 days
  • Top authors: f.n174 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 13,939 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/advanced-font-changer/inc/classes/class_afcfonts.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; afcfonts has a deprecated constructor

Server metrics [RAM: ▼0.02MB] [CPU: ▼306.10ms] Passed 4 tests

Analyzing server-side resources used by Advanced Font Changer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0156.83 ▲0.27
Dashboard /wp-admin3.41 ▲0.0038.75 ▼7.71
Posts /wp-admin/edit.php3.64 ▲0.0042.10 ▲0.94
Add New Post /wp-admin/post-new.php6.88 ▼0.0993.92 ▼1,213.23
Media Library /wp-admin/upload.php3.29 ▲0.0024.19 ▼3.72

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 56 new files
Database: 1 new table, 2 new options
New tables
wp_afc_fonts
New WordPress options
afc_db_vertion
afc_general_settings

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Font Changer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,781 ▲3615.65 ▲0.066.38 ▼0.212.67 ▲0.58
Dashboard /wp-admin2,878 ▲276.10 ▼0.07114.18 ▼16.81159.46 ▼5.08
Posts /wp-admin/edit.php2,694 ▲63.25 ▼0.0063.73 ▲0.42140.43 ▼4.95
Add New Post /wp-admin/post-new.php1,668 ▲719.72 ▲3.66423.95 ▲6.42156.80 ▼0.42
Media Library /wp-admin/upload.php1,698 ▲35.44 ▼0.07138.56 ▼9.03183.53 ▼5.98

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_afc_fonts
  • Zombie WordPress options detected upon uninstall: 2 options
    • afc_general_settings
    • afc_db_vertion

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
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-font-changer/inc/admin/addexternalfont.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-font-changer/inc/admin/uploadfonts.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-font-changer/inc/admin/editselector.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-font-changer/inc/afc-ajax.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-font-changer/inc/admin/editfont.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-font-changer/inc/admin/addselector.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'AFC_WP_List_Table' not found in wp-content/plugins/advanced-font-changer/inc/classes/class_fontslist.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'AFC_WP_List_Table' not found in wp-content/plugins/advanced-font-changer/inc/classes/class_selectorslist.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-font-changer/inc/admin/general.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'afctables' not found in wp-content/plugins/advanced-font-changer/inc/classes/class_defaults.php:5

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% 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 your attention:
  • Requires at least: Invalid version format
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
  • Donate link: Invalid URI ("")
The official readme.txt might help

advanced-font-changer/advanced-font-changer.php Passed 13 tests

The primary PHP file in "Advanced Font Changer" version 1.5.5 is used by WordPress to initiate all plugin functionality
111 characters long description:
This plugin lets you visually change the font and other text properties in your theme, using its visual editor.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected16,324 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
CSS83784705,403
SVG2004,458
PHP224991,1134,186
JavaScript7881081,223
PO File24054871,054

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity42.90
▷ Minimum class complexity2.00
▷ Maximum class complexity145.00
Average method complexity4.55
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods118
▷ Static methods10.85%
▷ Public methods118100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions93
▷ Named functions93100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin