84% petje-af

Code Review | Petje.af

WordPress plugin Petje.af scored84%from 54 tests.

About plugin

  • Plugin page: petje-af
  • Plugin version: 2.1.8
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-5.7
  • WordPress version: 6.3.1
  • First release: Jan 1, 2020
  • Latest release: Mar 25, 2021
  • Number of updates: 13
  • Update frequency: every 34.6 days
  • Top authors: petjeaf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /774 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.36MB] [CPU: ▼5.48ms] Passed 4 tests

A check of server-side resources used by Petje.af
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4243.34 ▲7.61
Dashboard /wp-admin3.71 ▲0.3645.45 ▼12.13
Posts /wp-admin/edit.php3.76 ▲0.4049.28 ▲0.18
Add New Post /wp-admin/post-new.php6.24 ▲0.3589.54 ▼12.21
Media Library /wp-admin/upload.php3.57 ▲0.3436.27 ▲2.23

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 43 new files
Database: no new tables, 10 new options
New WordPress options
widget_recent-comments
petje_af_account_page
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
petje_af_access_denied_page
db_upgraded
petje_af_redirect_uri_page
widget_petje_af_main_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Petje.af: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,972 ▲18613.54 ▼0.718.93 ▲7.2037.07 ▼3.33
Dashboard /wp-admin2,264 ▲835.59 ▼0.1287.61 ▼8.8135.70 ▼8.98
Posts /wp-admin/edit.php2,172 ▲722.02 ▲0.0136.53 ▼0.8532.20 ▼3.78
Add New Post /wp-admin/post-new.php6,277 ▲4,75125.83 ▲2.37898.49 ▲204.4751.10 ▼0.79
Media Library /wp-admin/upload.php1,471 ▲714.24 ▲0.0397.53 ▲0.2442.46 ▼1.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 10 options
    • widget_petje_af_main_widget
    • widget_theysaidso_widget
    • petje_af_redirect_uri_page
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • petje_af_access_denied_page
    • petje_af_account_page

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/petje-af/includes/widgets/petje-af-main-widget.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/petje-af/admin/partials/petje-af-admin-display.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/petje-af/admin/partials/petje-af-meta-box.php:17

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 97% from 29 tests

readme.txt 94% 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: Screenshot #1 (The Petje.af admin WordPress admin area where you should fill in your Client ID and Client secret.) image missing
The official readme.txt is a good inspiration

petje-af/petje-af.php Passed 13 tests

The main PHP file in "Petje.af" ver. 2.1.8 adds more information about the plugin and also serves as the entry point for this plugin
39 characters long description:
The official Petje.af WordPress plugin.

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
No dangerous file extensions were detected2,264 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP235581,6401,668
PO File183580207
CSS32412183
JavaScript43337181
JSON10013
SVG10110
Markdown1102

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.72
▷ Minimum class complexity1.00
▷ Maximum class complexity34.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes00.00%
Methods125
▷ Static methods97.20%
▷ Public methods8064.00%
▷ Protected methods4032.00%
▷ Private methods54.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
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
public/images/petjeaf.png13.70KB6.11KB▼ 55.41%