78% codoc

Code Review | codoc

WordPress plugin codoc scored78%from 54 tests.

About plugin

  • Plugin page: codoc
  • Plugin version: 0.9.51.10
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 19, 2019
  • Latest release: Oct 11, 2023
  • Number of updates: 127
  • Update frequency: every 11.9 days
  • Top authors: codoc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active /43,911 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.28MB] [CPU: ▼1.44ms] 75% from 4 tests

A check of server-side resources used by codoc
Please have a look at the following items
  • CPU: Total CPU usage must kept under 500.00ms (currently 988.55ms on /wp-admin/options-general.php?page=codoc)
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2943.28 ▲6.40
Dashboard /wp-admin3.60 ▲0.2551.21 ▼6.51
Posts /wp-admin/edit.php3.71 ▲0.3546.09 ▼1.56
Add New Post /wp-admin/post-new.php6.18 ▲0.2996.11 ▲1.03
Media Library /wp-admin/upload.php3.52 ▲0.2937.75 ▲1.29
codoc /wp-admin/options-general.php?page=codoc3.50988.55

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 28 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
codoc_settings
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

codoc: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲6314.35 ▼0.012.21 ▲0.6146.62 ▲3.16
Dashboard /wp-admin2,204 ▲235.60 ▼0.1282.08 ▼13.1838.17 ▼7.13
Posts /wp-admin/edit.php2,103 ▲31.99 ▼0.0334.49 ▼0.0331.88 ▼5.03
Add New Post /wp-admin/post-new.php1,542 ▲1418.43 ▼4.73658.63 ▼20.6264.62 ▲9.10
Media Library /wp-admin/upload.php1,406 ▲94.18 ▼0.0194.79 ▼3.0240.86 ▼2.83
codoc /wp-admin/options-general.php?page=codoc7982.0022.9931.32

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • codoc_settings
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

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

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/codoc/views/codoc-injector.php
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/codoc/views/codoc-shortcodes-list.php on line 1
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/codoc/views/codoc-injector.php on line 1
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/codoc/views/codoc-injector.php on line 1
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/class-http.php' (include_path='.:/usr/share/php') in wp-content/plugins/codoc/class-codoc-util.php on line 14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/codoc/views/codoc-injector.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/codoc/class-codoc.php:2
    • > PHP Warning
      require_once(ABSPATHwp-includes/class-http.php): failed to open stream: No such file or directory in wp-content/plugins/codoc/class-codoc-util.php on line 14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/codoc/class-codoc-util.php on line 14
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/codoc/views/codoc-shortcodes-list.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/codoc/views/codoc-shortcodes-list.php:9

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3 in codoc/assets to your readme.txt
You can take inspiration from this readme.txt

codoc/codoc.php Passed 13 tests

The main file in "codoc" v. 0.9.51.10 serves as a complement to information provided in readme.txt and as the entry point to the plugin
110 characters long description:
A WordPress plugin for monetizing websites by enabling paid articles, subscriptions(memberships), and tipping.

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
No dangerous file extensions were detected2,455 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP61151751,440
JavaScript66441473
PO File1114133283
CSS4372150
Sass36490
JSON20018
SVG1001

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity114.00
▷ Minimum class complexity102.00
▷ Maximum class complexity126.00
Average method complexity5.19
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes2100.00%
Methods32
▷ Static methods00.00%
▷ Public methods32100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions34
▷ Named functions12.94%
▷ Anonymous functions3397.06%
Constants10
▷ Global constants220.00%
▷ Class constants880.00%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
src_mce/more.png4.00KB1.37KB▼ 65.86%