79% custom-fields-for-post-and-pages

Code Review | Custom Fields for post and pages

WordPress plugin Custom Fields for post and pages scored 79% from 54 tests.

About plugin

  • Plugin page: custom-fields-for...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Jun 29, 2016
  • Latest release: Jun 29, 2016
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: farvehandleren (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 966 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.93MB] [CPU: ▼33.48ms] Passed 4 tests

Server-side resources used by Custom Fields for post and pages
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0339.13 ▼1.75
Dashboard /wp-admin3.02 ▼0.2922.09 ▼32.39
Posts /wp-admin/edit.php3.02 ▼0.3421.56 ▼23.21
Add New Post /wp-admin/post-new.php3.02 ▼2.8723.29 ▼67.16
Media Library /wp-admin/upload.php3.02 ▼0.2125.61 ▼11.16

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Fields for post and pages
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲8214.74 ▲0.371.67 ▼0.1945.55 ▼0.18
Dashboard /wp-admin2,223 ▲385.99 ▲1.06100.39 ▼23.8176.41 ▲23.09
Posts /wp-admin/edit.php2,106 ▲172.00 ▲0.0240.23 ▲6.4736.29 ▼0.13
Add New Post /wp-admin/post-new.php6,622 ▲5,08022.02 ▲3.961,131.17 ▲371.6161.40 ▼28.37
Media Library /wp-admin/upload.php1,402 ▲174.25 ▲0.08119.42 ▲6.2481.58 ▲31.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: posts, custom, fields, custom fields, post custom field

custom-fields-for-post-and-pages/ri_cf.php 85% from 13 tests

The principal PHP file in "Custom Fields for post and pages" v. 1.0 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-fields-for-post-and-pages.php" instead of "ri_cf.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin262 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24729219
CSS11029
JavaScript11014

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.62
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.09MB with 0.09MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
(invalid) img/plugin-icon.png91.15KB0.00KB▼ 100.00%