83% martincv-openai-blog-post

Code Review | MartinCV OpenAi Post

WordPress plugin MartinCV OpenAi Post scored83%from 54 tests.

About plugin

  • Plugin page: martincv-openai-b...
  • Plugin version: 1.0
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 14, 2022
  • Latest release: Sep 29, 2023
  • Number of updates: 10
  • Update frequency: every 28.9 days
  • Top authors: martin7ba (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /801 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.65ms] Passed 4 tests

This is a short check of server-side resources used by MartinCV OpenAi Post
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.56 ▼0.13
Dashboard /wp-admin3.36 ▲0.0646.35 ▼5.43
Posts /wp-admin/edit.php3.48 ▲0.1249.23 ▼5.21
Add New Post /wp-admin/post-new.php5.97 ▲0.0889.48 ▼11.83
Media Library /wp-admin/upload.php3.29 ▲0.0539.13 ▲5.23
OpenAi Post /wp-admin/options-general.php?page=martincv-openai-post-settings3.2734.90

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for MartinCV OpenAi Post
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.34 ▼0.001.92 ▼0.3246.20 ▲5.58
Dashboard /wp-admin2,202 ▲225.62 ▲0.0991.78 ▼7.1144.14 ▲0.31
Posts /wp-admin/edit.php2,111 ▲82.02 ▼0.0139.13 ▼0.8737.21 ▼0.42
Add New Post /wp-admin/post-new.php6,376 ▲4,85025.81 ▲2.61948.10 ▲258.1665.36 ▲9.39
Media Library /wp-admin/upload.php1,401 ▲14.18 ▼0.10105.36 ▲0.2145.30 ▼1.07
OpenAi Post /wp-admin/options-general.php?page=martincv-openai-post-settings9382.0325.4628.55

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/martincv-openai-blog-post/views/admin/template-admin-post-metabox.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/martincv-openai-blog-post/views/admin/template-admin-dashboard.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Contributors: The plugin contributors field is not present
You can take inspiration from this readme.txt

martincv-openai-blog-post/martincv-openai-post.php 85% from 13 tests

The main PHP file in "MartinCV OpenAi Post" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("martincv-openai-blog-post.php" instead of "martincv-openai-post.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
There were no executable files found in this plugin752 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9122252532
JavaScript1300155
Markdown127045
CSS15020

PHP code Passed 2 tests

An short overview of 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.29
Average class complexity8.00
▷ Minimum class complexity3.00
▷ Maximum class complexity25.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces4
Interfaces0
Traits1
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods23
▷ Static methods28.70%
▷ Public methods1565.22%
▷ Protected methods00.00%
▷ Private methods834.78%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin