88% flatty-flat-admin-theme

Code Review | Flatty - Flat Admin Theme

WordPress plugin Flatty - Flat Admin Theme scored 88% from 54 tests.

About plugin

  • Plugin page: flatty-flat-admin...
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8.0
  • WordPress version: 5.8.1
  • First release: Mar 25, 2016
  • Latest release: Jun 15, 2017
  • Number of updates: 88
  • Update frequency: every 5.1 days
  • Top authors: michelemarri (100%)

Code review

54 tests

User reviews

28 reviews

Install metrics

1,000+ active / 32,675 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▼125.37ms] Passed 4 tests

A check of server-side resources used by Flatty - Flat Admin Theme
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.18 ▲0.3544.11 ▲11.54
Dashboard /wp-admin3.58 ▲0.5274.99 ▲29.01
Posts /wp-admin/edit.php3.63 ▲0.5267.35 ▲23.43
Add New Post /wp-admin/post-new.php5.83 ▲0.40106.62 ▼547.34
Media Library /wp-admin/upload.php3.44 ▲0.4452.82 ▲10.90
Flatty /wp-admin/admin.php?page=menu_main3.4349.76
Dashboard /wp-admin/admin.php?page=menu_sub_dashboard3.4352.08
Login /wp-admin/admin.php?page=menu_sub_login3.4350.97
Appearance /wp-admin/admin.php?page=menu_sub_appearance3.4446.45
Business Card /wp-admin/admin.php?page=menu_sub_business_card3.4353.94
Posts & Pages /wp-admin/admin.php?page=menu_sub_postspages3.4349.85

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 74 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Flatty - Flat Admin Theme
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,071 ▲47518.13 ▲2.379.21 ▼1.9144.00 ▼3.29
Dashboard /wp-admin3,279 ▲3488.33 ▲2.30176.66 ▲17.69189.77 ▲81.10
Posts /wp-admin/edit.php3,099 ▲3604.55 ▲1.8386.58 ▲17.36179.31 ▲92.04
Add New Post /wp-admin/post-new.php1,783 ▲20218.35 ▲1.09379.32 ▼58.19126.76 ▼20.82
Media Library /wp-admin/upload.php1,939 ▲1324.88 ▼0.16125.46 ▼52.48148.49 ▲6.73
Flatty /wp-admin/admin.php?page=menu_main1,5774.0270.03180.16
Dashboard /wp-admin/admin.php?page=menu_sub_dashboard1,6363.7774.05142.30
Login /wp-admin/admin.php?page=menu_sub_login2,2313.8178.81179.54
Appearance /wp-admin/admin.php?page=menu_sub_appearance2,8024.58114.85191.71
Business Card /wp-admin/admin.php?page=menu_sub_business_card1,8733.9075.22175.25
Posts & Pages /wp-admin/admin.php?page=menu_sub_postspages2,0253.8075.90150.26

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/flatty-flat-admin-theme/includes/menu/icon.php
  • 29× 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/flatty-flat-admin-theme/includes/init/options/dashboard.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/flatty-flat-admin-theme/includes/init/options/login/recaptcha.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flatty-flat-admin-theme/includes/init/options/dashboard/support_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flatty-flat-admin-theme/includes/init/media_loader.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/flatty-flat-admin-theme/includes/init/options/login/logo.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flatty-flat-admin-theme/includes/init/options/appearance/topbar.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/flatty-flat-admin-theme/includes/init/options/business_card.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flatty-flat-admin-theme/includes/menu/menu-sub-login.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/flatty-flat-admin-theme/includes/init/options/login/messages.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/flatty-flat-admin-theme/includes/pages/main_dashboard.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (29 tag instead of maximum 10)
You can take inspiration from this readme.txt

flatty-flat-admin-theme/flatty-admin-theme.php 92% from 13 tests

The main PHP script in "Flatty - Flat Admin Theme" version 2.0.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("flatty-flat-admin-theme.php" instead of "flatty-admin-theme.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected5,377 lines of code in 58 files:
LanguageFilesBlank linesComment linesLines of code
PHP342241502,830
CSS211052451,534
SVG101533
PO File1123127269
JavaScript14618211

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.32MB with 0.18MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/vendor/color-picker-h.png1.66KB1.66KB0.41%
assets/icon-256x256.png67.46KB24.39KB▼ 63.85%
assets/arrow-down.png14.93KB0.33KB▼ 97.81%
assets/css/vendor/color-picker-sv.png106.66KB50.25KB▼ 52.88%
assets/banner-772x250.png76.88KB19.31KB▼ 74.88%