78% earnfrom-shoppydoo

Code Review | Earn from Shoppydoo

WordPress plugin Earn from Shoppydoo scored78%from 54 tests.

About plugin

  • Plugin page: earnfrom-shoppydoo
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.7
  • WordPress version: 6.3.1
  • First release: Feb 7, 2017
  • Latest release: Feb 8, 2017
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: danielecr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /603 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▼2.19ms] Passed 4 tests

An overview of server-side resources used by Earn from Shoppydoo
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1042.32 ▼0.05
Dashboard /wp-admin3.41 ▲0.0750.09 ▼10.38
Posts /wp-admin/edit.php3.52 ▲0.1751.81 ▲3.61
Add New Post /wp-admin/post-new.php5.99 ▲0.11100.29 ▲2.97
Media Library /wp-admin/upload.php3.33 ▲0.1138.17 ▼1.31
Earn from Shoppydoo /wp-admin/options-general.php?page=shoppydoowp-options3.3140.95

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 20 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Earn from Shoppydoo
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲8314.21 ▼0.021.92 ▼0.0441.59 ▼3.49
Dashboard /wp-admin2,193 ▲135.57 ▼0.0885.84 ▼4.3637.97 ▼2.74
Posts /wp-admin/edit.php2,104 ▲12.02 ▲0.0540.13 ▲3.5235.25 ▲1.38
Add New Post /wp-admin/post-new.php1,547 ▲2018.30 ▼4.70598.32 ▼107.3171.50 ▲16.28
Media Library /wp-admin/upload.php1,398 ▼24.19 ▼0.05104.06 ▼9.1246.36 ▼3.43
Earn from Shoppydoo /wp-admin/options-general.php?page=shoppydoowp-options1,0242.0223.6743.26

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=shoppydoowp-options
    • > Notice in wp-content/plugins/earnfrom-shoppydoo/tmpl/admin-shoppydoo.php+64
    Trying to access array offset on value of type bool

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
Please fix the following items
  • 34× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type bool in wp-content/plugins/earnfrom-shoppydoo/test/fakeWpdb.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/earnfrom-shoppydoo/tmpl/tag-creator-window.php:1
    • > PHP Notice
      Trying to access array offset on value of type bool in wp-content/plugins/earnfrom-shoppydoo/test/fakeWpdb.php on line 14
    • > PHP Fatal error
      require_once(): Failed opening required '../bbplanetwp.php' (include_path='.:/usr/share/php') in wp-content/plugins/earnfrom-shoppydoo/test/testPlugin.class.php on line 23
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/earnfrom-shoppydoo/test/testParser.php:21
    • > PHP Warning
      mysqli::__construct(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in wp-content/plugins/earnfrom-shoppydoo/test/fakeWpdb.php on line 17
    • > PHP Warning
      mysqli::__construct(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in wp-content/plugins/earnfrom-shoppydoo/test/fakeWpdb.php on line 17
    • > PHP Notice
      Trying to access array offset on value of type bool in wp-content/plugins/earnfrom-shoppydoo/test/fakeWpdb.php on line 14
    • > PHP Notice
      Trying to access array offset on value of type bool in wp-content/plugins/earnfrom-shoppydoo/test/fakeWpdb.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_url() in wp-content/plugins/earnfrom-shoppydoo/tmpl/tag-creator.php:2

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 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
You can take inspiration from this readme.txt

earnfrom-shoppydoo/earnfromsd.php 92% from 13 tests

The primary PHP file in "Earn from Shoppydoo" version 1.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("earnfrom-shoppydoo.php" instead of "earnfromsd.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin1,143 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP192322401,143

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity6.36
▷ Minimum class complexity1.00
▷ Maximum class complexity18.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods69
▷ Static methods00.00%
▷ Public methods6492.75%
▷ Protected methods00.00%
▷ Private methods57.25%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin