84% key-figures

Code Review | Key Figures

WordPress plugin Key Figures scored84%from 54 tests.

About plugin

  • Plugin page: key-figures
  • Plugin version: 1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 6.3.1
  • First release: Apr 25, 2017
  • Latest release: Oct 31, 2017
  • Number of updates: 6
  • Update frequency: every 31.5 days
  • Top authors: audrasjb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,945 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.14MB] [CPU: ▼3.78ms] Passed 4 tests

Analyzing server-side resources used by Key Figures
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.93 ▼2.64
Dashboard /wp-admin3.47 ▲0.1747.48 ▼5.42
Posts /wp-admin/edit.php3.58 ▲0.2350.21 ▲4.48
Add New Post /wp-admin/post-new.php6.07 ▲0.1885.80 ▼6.99
Media Library /wp-admin/upload.php3.39 ▲0.1635.55 ▼0.05
Key figures /wp-admin/options-general.php?page=key-figures3.3633.04

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Key Figures
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲8213.86 ▼0.811.63 ▼0.2043.02 ▼1.28
Dashboard /wp-admin2,237 ▲635.16 ▼0.80111.77 ▼8.4737.12 ▼9.07
Posts /wp-admin/edit.php2,116 ▲272.30 ▲0.3038.59 ▲0.5235.16 ▲3.08
Add New Post /wp-admin/post-new.php1,537 ▲1823.32 ▲0.06663.82 ▼29.7936.23 ▼36.32
Media Library /wp-admin/upload.php1,411 ▲204.39 ▲0.2089.68 ▼8.0542.90 ▼4.27
Key figures /wp-admin/options-general.php?page=key-figures2,0132.4769.5232.56

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 did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • 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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/key-figures/public/kf-public.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/key-figures/admin/kf-admin.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
10 plugin tags: figures, chiffre, keyfigures, chiffre-cl, cl...

key-figures/key-figures.php Passed 13 tests

The entry point to "Key Figures" version 1.1 is a PHP file that has certain tags in its header comment area
81 characters long description:
Display key figures with custom styles and animations in WordPress visual editor.

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
No dangerous file extensions were detected1,421 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP41461171,327
JavaScript23150
CSS22644

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.28
Average class complexity6.00
▷ Minimum class complexity6.00
▷ Maximum class complexity6.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions23100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
10 PNG files occupy 0.70MB with 0.50MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-5.png67.08KB20.27KB▼ 69.78%
assets/screenshot-1.png91.37KB23.28KB▼ 74.52%
assets/screenshot-6.png81.78KB21.10KB▼ 74.20%
assets/screenshot-3.png123.45KB34.51KB▼ 72.04%
assets/icon-128x128.png8.63KB3.18KB▼ 63.15%