68% flat-ui-button

Code Review | Flat UI Button

WordPress plugin Flat UI Button scored68%from 54 tests.

About plugin

  • Plugin page: flat-ui-button
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.0
  • WordPress version: 6.3.1
  • First release: Jun 5, 2013
  • Latest release: Jun 5, 2013
  • Number of updates: 4
  • Update frequency: N/A
  • Top authors: tiandi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,338 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.95MB] [CPU: ▼32.50ms] Passed 4 tests

Analyzing server-side resources used by Flat UI Button
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.78 ▼6.25
Dashboard /wp-admin2.99 ▼0.3123.05 ▼27.71
Posts /wp-admin/edit.php2.99 ▼0.3623.34 ▼21.88
Add New Post /wp-admin/post-new.php2.99 ▼2.8924.75 ▼66.48
Media Library /wp-admin/upload.php2.99 ▼0.2422.31 ▼13.94
Flat UI Button /wp-admin/options-general.php?page=flatbtninfo2.9923.04

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Flat UI Button
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.56 ▼0.811.87 ▲0.0938.97 ▼3.23
Dashboard /wp-admin2,213 ▲215.86 ▲0.9696.80 ▼11.8939.45 ▼4.24
Posts /wp-admin/edit.php2,093 ▲42.01 ▼0.0540.38 ▲6.2135.29 ▲1.43
Add New Post /wp-admin/post-new.php1,531 ▼322.98 ▼0.19693.66 ▲13.8253.79 ▼6.74
Media Library /wp-admin/upload.php1,386 ▲14.31 ▲0.1495.00 ▼12.1741.53 ▼4.87
Flat UI Button /wp-admin/options-general.php?page=flatbtninfo8072.0124.4824.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=flatbtninfo
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=flatbtninfo
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=flatbtninfo
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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 fix the following
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/flat-ui-button/flatbtn.php:47

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Screenshot #1 (UI example.) image required
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === flat-ui-button === )
You can look at the official readme.txt

flat-ui-button/flatbtn.php 92% from 13 tests

The primary PHP file in "Flat UI Button" version 1.0 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("flat-ui-button.php" instead of "flatbtn.php")

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
Everything looks great! No dangerous files found in this plugin270 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
CSS143228
PHP15842

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png15.17KB6.31KB▼ 58.42%