10% form1

Code Review | Form1

WordPress plugin Form1 scored 10% from 54 tests.

About plugin

  • Plugin page: form1
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.2-4.4.2
  • WordPress version: 5.9.2
  • First release: Mar 3, 2016
  • Latest release: Mar 8, 2016
  • Number of updates: 9
  • Update frequency: every 0.7 days
  • Top authors: ki6ool (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,899 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • The plugin did not install without errors
    • > User notice in wp-includes/functions.php+5768
    register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼2.49MB] [CPU: ▼348.22ms] Passed 4 tests

An overview of server-side resources used by Form1
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /1.87 ▼1.645.39 ▼46.94
Dashboard /wp-admin1.89 ▼1.513.71 ▼30.80
Posts /wp-admin/edit.php1.89 ▼1.753.85 ▼34.03
Add New Post /wp-admin/post-new.php1.89 ▼5.084.44 ▼1,281.09
Media Library /wp-admin/upload.php1.89 ▼1.404.77 ▼21.51
設定 /wp-admin/admin.php?page=form1_settings1.894.58
履歴 /wp-admin/admin.php?page=form1_histories1.895.26

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: 1 new table, no new options
New tables
wp_form1

Browser metrics Passed 4 tests

This is an overview of browser requirements for Form1
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,817 ▲9516.23 ▲0.205.56 ▲0.072.25 ▲0.17
Dashboard /wp-admin2,923 ▲696.13 ▼0.03121.49 ▼10.81171.50 ▲7.44
Posts /wp-admin/edit.php2,725 ▲313.23 ▼0.0162.69 ▼1.38151.99 ▲2.03
Add New Post /wp-admin/post-new.php1,683 ▲2817.01 ▼3.50422.67 ▲0.27171.59 ▼21.66
Media Library /wp-admin/upload.php1,732 ▲405.48 ▼0.11146.21 ▼3.09202.17 ▼42.14
設定 /wp-admin/admin.php?page=form1_settings1,4442.3757.44220.87
履歴 /wp-admin/admin.php?page=form1_histories1,2082.3753.94121.66

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5768
    register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • Zombie tables detected upon uninstall: 1 table
    • wp_form1

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
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=form1_histories
    • > User notice in wp-includes/functions.php+5768
    register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

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
Almost there! Just fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/form1/history.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/form1/form1.php:62
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/form1/history.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/form1/history.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (設定管理画面), #2 (履歴管理画面), #3 (フォーム表示例)
Please take inspiration from this readme.txt

form1/form1.php Passed 13 tests

The entry point to "Form1" version 1.0.2 is a PHP file that has certain tags in its header comment area
96 characters long description:
シンプルなお問い合わせフォームを設置します。履歴も管理できます。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin662 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP59212661
JavaScript1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity24.40
▷ Minimum class complexity11.00
▷ Maximum class complexity38.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes360.00%
Methods41
▷ Static methods12.44%
▷ Public methods3380.49%
▷ Protected methods00.00%
▷ Private methods819.51%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants8
▷ Global constants562.50%
▷ Class constants337.50%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.34MB with 0.25MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png61.20KB14.59KB▼ 76.15%
screenshot-1.png128.21KB33.99KB▼ 73.49%
screenshot-2.png157.32KB44.66KB▼ 71.61%