88% wp-post-enricher

Code Review | WP Post Enricher

WordPress plugin WP Post Enricher scored 88% from 54 tests.

About plugin

  • Plugin page: wp-post-enricher
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 5.9.2
  • First release: Apr 6, 2016
  • Latest release: Apr 2, 2016
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: lfbn (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 409 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼288.57ms] Passed 4 tests

A check of server-side resources used by WP Post Enricher
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0355.08 ▲4.98
Dashboard /wp-admin3.45 ▲0.0532.82 ▼1.52
Posts /wp-admin/edit.php3.67 ▲0.0337.53 ▼0.93
Add New Post /wp-admin/post-new.php6.92 ▼0.0596.29 ▼1,144.40
Media Library /wp-admin/upload.php3.33 ▲0.0323.02 ▼7.43

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 24 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Post Enricher
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,789 ▲6715.92 ▲0.456.10 ▲0.602.29 ▼0.45
Dashboard /wp-admin2,973 ▲1186.08 ▼0.19120.88 ▼16.59167.25 ▲4.01
Posts /wp-admin/edit.php2,773 ▲893.25 ▲0.0262.35 ▼1.20154.66 ▲19.48
Add New Post /wp-admin/post-new.php1,753 ▲6318.24 ▼2.46409.77 ▼48.25158.67 ▼0.28
Media Library /wp-admin/upload.php1,752 ▲545.57 ▲0.08140.40 ▼6.70184.11 ▼11.09

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 take a closer look at the following
  • 5× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wp-post-enricher/views/response-table-twitter.php
    • > /wp-content/plugins/wp-post-enricher/views/post-edit-meta-box.php
    • > /wp-content/plugins/wp-post-enricher/views/response-table-youtube.php
    • > /wp-content/plugins/wp-post-enricher/views/response-table-google-search.php
    • > /wp-content/plugins/wp-post-enricher/views/response-table-word-metrics.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/wp-post-enricher/views/response-table-google-search.php on line 8
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/wp-post-enricher/views/response-table-twitter.php on line 8
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-post-enricher/views/response-table-twitter.php on line 8
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/wp-post-enricher/views/response-table-youtube.php on line 9
    • > PHP Notice
      Undefined variable: loadingImgUrl in wp-content/plugins/wp-post-enricher/views/post-edit-meta-box.php on line 34
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-post-enricher/views/response-table-google-search.php on line 8
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-post-enricher/views/response-table-youtube.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'PostEnricher\\Controller\\BaseController' not found in wp-content/plugins/wp-post-enricher/src/PostEnricher/Controller/SearchController.php:8
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/wp-post-enricher/views/response-table-word-metrics.php on line 11
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-post-enricher/views/response-table-word-metrics.php on line 11

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

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screen shot shows what the meta box, in the new post page, look like.), #2 (You can search for youtube videos.), #3 (And also for Word Metrics, like CPC, competition, number of results and search volume.)
The official readme.txt is a good inspiration

wp-post-enricher/wp-post-enricher.php Passed 13 tests

"WP Post Enricher" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
104 characters long description:
Official WP Post Enricher plugin for WordPress. Improve your post creation. Requires PHP 5.4 or greater.

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
No dangerous file extensions were detected647 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP18130251575
JavaScript17034
CSS10020
Markdown115018

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity2.50
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.52
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods29
▷ Static methods1551.72%
▷ Public methods2689.66%
▷ Protected methods00.00%
▷ Private methods310.34%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin