Title: Error when using WP-CLI
Last modified: May 7, 2023

---

# Error when using WP-CLI

 *  [gmariani405](https://wordpress.org/support/users/gmariani405/)
 * (@gmariani405)
 * [3 years ago](https://wordpress.org/support/topic/error-when-using-wp-cli-5/)
 *     ```wp-block-code
       PHP Warning:  Trying to access array offset on value of type null in /chroot/home/USER/DOMAIN/html/wp-content/plugins/cryptx/include/functions.php on line 428
       ```
   
 * Ran into this error when using WP-CLI. When using WP-CLI not all globals are 
   available, if you could just put in a check that the variable exists that should
   do it. It’s in this part:
 *     ```wp-block-code
       /**
        *  add ID to exclude list
        */
       function rw_cryptx_insert_post($pID) {
           global $cryptX_var, $post;
           $rev = wp_is_post_revision($pID);
           if($rev) $pID = $rev;
           $b = explode(",", $cryptX_var['excludedIDs']); // LINE 428
           if($b[0] == '') unset($b[0]);
           foreach($b as $x=>$y) {
               if($y == $pID) {
                   unset($b[$x]);
                   break;
               }
           }
           if (isset($_POST['cryptxoff'])) $b[] = $pID;
           $b = array_unique($b);
           sort($b);
           $cryptX_var['excludedIDs'] = implode(",", $b);
           update_option( 'cryptX', $cryptX_var);
           $cryptX_var = rw_loadDefaults(); // reread Options
       }
       ```
   
 * CryptX 3.3.3.2 / WordPress 6.2 / PHP 8.0.28

The topic ‘Error when using WP-CLI’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/cryptx.svg)
 * [CryptX](https://wordpress.org/plugins/cryptx/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/cryptx/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/cryptx/)
 * [Active Topics](https://wordpress.org/support/plugin/cryptx/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/cryptx/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/cryptx/reviews/)

## Tags

 * [wp-cli](https://wordpress.org/support/topic-tag/wp-cli/)

 * 0 replies
 * 1 participant
 * Last reply from: [gmariani405](https://wordpress.org/support/users/gmariani405/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/error-when-using-wp-cli-5/)
 * Status: not resolved