10% form1

Code Review | Form1

WordPress plugin Form1 scored10%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: 6.3.1
  • 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

80+ active /2,086 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • The plugin did not install without errors
    • > User notice in wp-includes/functions.php+5905
    Function 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: ▼1.93MB] [CPU: ▼54.09ms] Passed 4 tests

Server-side resources used by Form1
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.407.94 ▼36.60
Dashboard /wp-admin2.08 ▼1.226.17 ▼44.17
Posts /wp-admin/edit.php2.08 ▼1.286.56 ▼43.12
Add New Post /wp-admin/post-new.php2.08 ▼3.816.38 ▼92.45
Media Library /wp-admin/upload.php2.08 ▼1.156.81 ▼29.21
設定 /wp-admin/admin.php?page=form1_settings2.086.61
履歴 /wp-admin/admin.php?page=form1_histories2.086.29

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 10 new files
Database: 1 new table, 6 new options
New tables
wp_form1
New WordPress options
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Form1
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9213.22 ▼1.161.67 ▼0.0441.54 ▼1.95
Dashboard /wp-admin2,230 ▲425.83 ▲0.9895.47 ▼19.3942.56 ▼8.54
Posts /wp-admin/edit.php2,116 ▲272.06 ▲0.0739.49 ▲2.4438.92 ▲6.38
Add New Post /wp-admin/post-new.php1,559 ▲3923.12 ▼0.12640.82 ▼39.1057.14 ▲5.44
Media Library /wp-admin/upload.php1,415 ▲304.21 ▲0.0095.52 ▼8.5845.98 ▲2.57
設定 /wp-admin/admin.php?page=form1_settings1,0882.0624.6675.09
履歴 /wp-admin/admin.php?page=form1_histories9492.2125.0138.30

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function 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 were found after uninstall: 1 table
    • wp_form1
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=form1_histories
    • > User notice in wp-includes/functions.php+5905
    Function 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 4× PHP files trigger server errors when accessed directly:
    • > 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
    • > 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 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

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • 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 principal PHP file in "Form1" v. 1.0.2 is loaded by WordPress automatically on each request
96 characters long description:
シンプルなお問い合わせフォームを設置します。履歴も管理できます。

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin662 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP59212661
JavaScript1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were 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

All PNG images should be compressed to minimize bandwidth usage for end users
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-2.png157.32KB44.66KB▼ 71.61%
screenshot-1.png128.21KB33.99KB▼ 73.49%