74% project-adv-inserter

Code Review | Project Adv Inserter

WordPress plugin Project Adv Inserter scored74%from 54 tests.

About plugin

  • Plugin page: project-adv-inserter
  • Plugin version: 1.2.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Dec 28, 2022
  • Latest release: Jun 12, 2023
  • Number of updates: 18
  • Update frequency: every 9.5 days
  • Top authors: projectadv (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /726 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼0.39ms] Passed 4 tests

Analyzing server-side resources used by Project Adv Inserter
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1239.76 ▼9.23
Dashboard /wp-admin3.40 ▲0.0946.50 ▼3.43
Posts /wp-admin/edit.php3.51 ▲0.1550.87 ▲5.46
Add New Post /wp-admin/post-new.php5.98 ▲0.09108.48 ▲15.74
Media Library /wp-admin/upload.php3.32 ▲0.0839.12 ▲5.63

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
projectadv_inserter_config
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Project Adv Inserter: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,871 ▲12513.52 ▼0.839.88 ▲8.1137.82 ▼5.19
Dashboard /wp-admin2,219 ▲285.81 ▲0.90106.54 ▼0.5638.81 ▼2.90
Posts /wp-admin/edit.php2,108 ▲192.00 ▼0.0239.67 ▲3.3836.54 ▲3.78
Add New Post /wp-admin/post-new.php1,560 ▲2718.20 ▼4.98624.36 ▼74.1867.92 ▲12.91
Media Library /wp-admin/upload.php1,407 ▲164.18 ▼0.0396.82 ▼3.3342.33 ▼1.35

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
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/project-adv-inserter/src/AdsTxt.php+39
    Trying to access array offset on value of type bool
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • projectadv_inserter_config
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Sferica\\Plugins\\ProjectAdvInserter\\get_option() in wp-content/plugins/project-adv-inserter/src/Config.php:69

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)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
2 plugin tags: banner, adv

project-adv-inserter/project-adv-inserter.php Passed 13 tests

Analyzing the main PHP file in "Project Adv Inserter" version 1.2.4
37 characters long description:
Il plugin ufficiale di Projectadv Srl

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
Everything looks great! No dangerous files found in this plugin2,917 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JSON2002,315
PHP119044564
JavaScript31138

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.90
▷ Minimum class complexity1.00
▷ Maximum class complexity15.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods49
▷ Static methods510.20%
▷ Public methods3061.22%
▷ Protected methods00.00%
▷ Private methods1938.78%
Functions10
▷ Named functions00.00%
▷ Anonymous functions10100.00%
Constants8
▷ Global constants00.00%
▷ Class constants8100.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected