Plugin Directory


Ignore:
Timestamp:
09/26/2026 04:03:31 PM (3 weeks ago)
Author:
TigrouMeow
Message:

Version 0.9.3.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • social-engine/trunk/common/admin.php

    r3628743 r3714445  
    204204      }
    205205      $isIssue = $this->isPro && !$this->is_registered();
     206
     207      // The licenser already knows WHY validation failed and stores it as
     208      // license['issue'] (licenser.php), but this badge used to render a flat
     209      // "License Issue" for every case. That sent people to support to ask a
     210      // question the plugin could have answered: the most common one by far is a
     211      // licence whose activation slot is held by another site, which reads as
     212      // "my licence is broken" and gets reported as a billing problem.
     213      $issueLabel = __( 'License Issue', $this->domain );
     214      if ( $isIssue ) {
     215        $license = get_option( $this->prefix . '_license', '' );
     216        $issue   = is_array( $license ) && !empty( $license['issue'] ) ? $license['issue'] : null;
     217        // Codes the store actually sends. Verified against EDD Software Licensing
     218        // rather than guessed: an invented key would silently never match, and a
     219        // wrong label is worse than the generic one.
     220        $labels  = [
     221          // `error` codes, from a failed activation.
     222          'no_activations_left'           => __( 'License in use on another site', $this->domain ),
     223          'expired'                       => __( 'License expired', $this->domain ),
     224          'disabled'                      => __( 'License revoked', $this->domain ),
     225          'missing'                       => __( 'License key not recognized', $this->domain ),
     226          'key_mismatch'                  => __( 'License key not recognized', $this->domain ),
     227          'item_name_mismatch'            => __( 'License is for another plugin', $this->domain ),
     228          'invalid_item_id'               => __( 'License is for another plugin', $this->domain ),
     229          'missing_item_id'               => __( 'License is for another plugin', $this->domain ),
     230          'bundle_activation_not_allowed' => __( 'This license cannot be activated directly', $this->domain ),
     231          // `license` statuses, when the key is known but not valid here.
     232          'site_inactive'                 => __( 'License not activated on this site', $this->domain ),
     233          'inactive'                      => __( 'License not activated on this site', $this->domain ),
     234          // Genuinely no answer from the store. NOT invalid_response, which means the
     235          // store replied and we could not make sense of it: blaming the connection
     236          // there would send people chasing a firewall that is working fine.
     237          'no_response'                   => __( 'License server unreachable', $this->domain ),
     238        ];
     239        if ( $issue !== null && isset( $labels[ $issue ] ) ) {
     240          $issueLabel = $labels[ $issue ];
     241        }
     242      }
    206243      if ( strpos( $pathName, $thisPathName ) !== false ) {
    207244        // In network admin, handle differently (no settings page available)
    … …  
    246283            $this->is_registered() ?
    247284              ( '<span style="color: #a75bd6;">' . __( 'Pro Version', $this->domain ) . '</span>' ) :
    248                   ( $isIssue ? ( sprintf( '<span style="color: #ff3434;">' . __( 'License Issue', $this->domain ), $this->prefix ) . '</span>' ) : ( sprintf( '<span>' . __( '<a target="_blank" href="https://meowapps.com">Get the <u>Pro Version</u></a>', $this->domain ), $this->prefix ) . '</span>' ) ),
     285                  ( $isIssue ? ( '<span style="color: #ff3434;">' . esc_html( $issueLabel ) . '</span>' ) : ( sprintf( '<span>' . __( '<a target="_blank" href="https://meowapps.com">Get the <u>Pro Version</u></a>', $this->domain ), $this->prefix ) . '</span>' ) ),
    249286          ];
    250287        }
Note: See TracChangeset for help on using the changeset viewer.