10% os-anspress-custom-fields

Code Review | OS AnsPress Custom Fields

WordPress plugin OS AnsPress Custom Fields scored 10% from 54 tests.

About plugin

  • Plugin page: os-anspress-custo...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Feb 9, 2016
  • Latest release: Oct 26, 2016
  • Number of updates: 3
  • Update frequency: every 86.7 days
  • Top authors: offshorent (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,572 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/os-anspress-custom-fields/os-anspress-custom-fileds.php+17
    Use of undefined constant AP_VERSION - assumed 'AP_VERSION' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.84MB] [CPU: ▼52.41ms] Passed 4 tests

Analyzing server-side resources used by OS AnsPress Custom Fields
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.316.09 ▼34.48
Dashboard /wp-admin2.17 ▼1.135.71 ▼43.96
Posts /wp-admin/edit.php2.17 ▼1.186.40 ▼43.48
Add New Post /wp-admin/post-new.php2.17 ▼3.726.47 ▼87.73
Media Library /wp-admin/upload.php2.17 ▼1.067.55 ▼27.30

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by OS AnsPress Custom Fields
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.47 ▲0.101.77 ▼0.1144.28 ▼0.66
Dashboard /wp-admin2,206 ▲154.86 ▼0.01105.62 ▼3.5440.80 ▼4.65
Posts /wp-admin/edit.php2,089 ▼02.00 ▲0.0139.51 ▼0.8735.82 ▼2.04
Add New Post /wp-admin/post-new.php1,514 ▼017.70 ▲0.18645.87 ▲61.2857.99 ▲10.58
Media Library /wp-admin/upload.php1,385 ▼34.16 ▼0.04100.40 ▼10.4844.21 ▼2.94

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/os-anspress-custom-fields/os-anspress-custom-fileds.php+17
    Use of undefined constant AP_VERSION - assumed 'AP_VERSION' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 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 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
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/os-anspress-custom-fields/includes/meta.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/os-anspress-custom-fields/includes/osap.custom-fields.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function ap_answer_user_can_view() in wp-content/plugins/os-anspress-custom-fields/includes/answer.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (OS AnsPress Custom Fields - Admin side interface), #2 (OS AnsPress Custom Fields - Front end interface)
The official readme.txt is a good inspiration

os-anspress-custom-fields/os-anspress-custom-fileds.php 92% from 13 tests

The principal PHP file in "OS AnsPress Custom Fields" v. 1.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("os-anspress-custom-fields.php" instead of "os-anspress-custom-fileds.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected991 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP46494839
CSS1010112
JavaScript101340

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity36.00
▷ Minimum class complexity36.00
▷ Maximum class complexity36.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.09MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/delete.png0.46KB0.54KB0.00%
screenshot-1.png48.20KB15.34KB▼ 68.17%
screenshot-2.png43.65KB14.53KB▼ 66.71%
images/down.png0.68KB0.76KB0.00%
images/up.png0.69KB0.76KB0.00%