94% turnstile

Code Review | Turnstile

WordPress plugin Turnstile scored 94% from 54 tests.

About plugin

  • Plugin page: turnstile
  • Plugin version: 1.4.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3
  • WordPress version: 5.8.1
  • First release: Mar 15, 2018
  • Latest release: Mar 23, 2020
  • Number of updates: 30
  • Update frequency: every 24.7 days
  • Top authors: sentimens (76.67%)caseyjchance (26.67%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 632 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼144.09ms] Passed 4 tests

Analyzing server-side resources used by Turnstile
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.96 ▲0.1340.29 ▼0.84
Dashboard /wp-admin3.35 ▲0.2947.29 ▼4.21
Posts /wp-admin/edit.php3.40 ▲0.2946.57 ▼4.42
Add New Post /wp-admin/post-new.php5.25 ▼0.1883.50 ▼566.88
Media Library /wp-admin/upload.php3.23 ▲0.2241.43 ▲3.92
Turnstile user tracking /wp-admin/options-general.php?page=turnstile-setting-admin3.1933.68

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 46 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Turnstile
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,850 ▲25417.71 ▲2.2618.72 ▲9.7847.34 ▼4.57
Dashboard /wp-admin2,971 ▲405.93 ▲0.03146.25 ▼8.65117.06 ▲0.04
Posts /wp-admin/edit.php2,748 ▲92.70 ▼0.0066.51 ▼4.2890.24 ▼14.23
Add New Post /wp-admin/post-new.php1,760 ▲7721.30 ▲3.12293.40 ▼95.93115.12 ▼3.75
Media Library /wp-admin/upload.php1,816 ▲65.05 ▲0.03176.04 ▲13.98130.48 ▲11.73
Turnstile user tracking /wp-admin/options-general.php?page=turnstile-setting-admin1,0482.1057.9175.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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 items
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/turnstile/src/includes/common/shortcodes.php
    • > /wp-content/plugins/turnstile/src/includes/admin/class-turnstile-admin.php
    • > /wp-content/plugins/turnstile/src/includes/admin/tinymce/wysiwyg.php
    • > /wp-content/plugins/turnstile/turnstile.php
    • > /wp-content/plugins/turnstile/src/includes/admin/auth.php
    • > /wp-content/plugins/turnstile/src/includes/admin/class-turnstile-meta-boxes.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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
1 plugin tags: analytics

turnstile/turnstile.php Passed 13 tests

The primary PHP file in "Turnstile" version 1.4.0 is used by WordPress to initiate all plugin functionality
19 characters long description:
Turnstile Analytics

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin1,318 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP222651381,073
JavaScript52135133
CSS351112

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity8.00
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity1.96
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes872.73%
Methods80
▷ Static methods1012.50%
▷ Public methods6783.75%
▷ Protected methods00.00%
▷ Private methods1316.25%
Functions30
▷ Named functions2996.67%
▷ Anonymous functions13.33%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 PNG files occupy 0.28MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-2.png85.02KB34.38KB▼ 59.56%
src/public/img/turnstile_logo_64.png1.67KB2.14KB0.00%
assets/icon-256x256.png25.14KB10.37KB▼ 58.74%
assets/screenshot-1.png170.18KB48.73KB▼ 71.37%
src/includes/admin/tinymce/icon_turnstile_24.png0.64KB0.87KB0.00%