77% cyberpret-calculettes

Code Review | Cyberpret - Calculettes

WordPress plugin Cyberpret - Calculettes scored77%from 54 tests.

About plugin

  • Plugin page: cyberpret-calcule...
  • Plugin version: 1.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7
  • WordPress version: 6.3.1
  • First release: Apr 7, 2016
  • Latest release: May 18, 2021
  • Number of updates: 96
  • Update frequency: every 19.5 days
  • Top authors: cyberpret (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

800+ active /6,080 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.18MB] [CPU: ▲3.33ms] Passed 4 tests

A check of server-side resources used by Cyberpret - Calculettes
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1848.99 ▲7.78
Dashboard /wp-admin3.48 ▲0.1857.62 ▲3.22
Posts /wp-admin/edit.php3.60 ▲0.2460.71 ▲8.38
Add New Post /wp-admin/post-new.php6.08 ▲0.2096.01 ▼6.08
Media Library /wp-admin/upload.php3.41 ▲0.1850.87 ▲11.09
Calculettes Cyberpret /wp-admin/options-general.php?page=cyberpretCalculettesAdmin3.3843.37
All Posts /wp-admin/edit.php?post_type=book3.4543.97

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Cyberpret - Calculettes
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲7714.36 ▲0.071.84 ▼0.0242.98 ▼1.99
Dashboard /wp-admin2,229 ▲525.76 ▲0.0990.10 ▲3.1640.32 ▼1.63
Posts /wp-admin/edit.php2,136 ▲362.30 ▲0.3235.29 ▼1.3533.58 ▼0.79
Add New Post /wp-admin/post-new.php1,554 ▲2621.89 ▼1.08702.24 ▲53.6636.37 ▼16.27
Media Library /wp-admin/upload.php1,434 ▲374.44 ▲0.28115.58 ▲10.6646.63 ▲1.30
Calculettes Cyberpret /wp-admin/options-general.php?page=cyberpretCalculettesAdmin3,5253.46108.4385.65
All Posts /wp-admin/edit.php?post_type=book1,0962.3934.0730.99

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cyberpret-calculettes/admin/cyberpretShortcodes.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cyberpret-calculettes/cyberpretCalculettes.php:22

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=book
    • > Network (severe)
    wp-content/plugins/cyberpret-calculettes/custom-script.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Espace d'administration du plugin, choix de la calculette.), #2 (Espace d'administration du plugin, choix de la couleur d'un élément.), #3 (Un exemple de calculette)
  • Tags: Please delete some tags, you are using 31 tag instead of maximum 10
Please take inspiration from this readme.txt

cyberpret-calculettes/cyberpretCalculettes.php 77% from 13 tests

This is the main PHP file of "Cyberpret - Calculettes" version 1.5.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 156 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cyberpret-calculettes.php" instead of "cyberpretCalculettes.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin779 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4197167744
CSS19129
JavaScript32156

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.15
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%
Functions36
▷ Named functions36100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
3 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png22.77KB10.82KB▼ 52.46%
screenshot-1.png57.45KB29.41KB▼ 48.80%
screenshot-2.png27.17KB18.23KB▼ 32.91%