Changeset 2775563
- Timestamp:
- 08/25/2022 01:39:43 PM (4 years ago)
- Location:
- ethpress/trunk
- Files:
-
- 1 added
- 13 edited
-
app/Admin/Options.php (modified) (15 diffs)
-
app/Dependencies/BN/BN.php (modified) (1 diff)
-
app/Front.php (modified) (3 diffs)
-
app/Login.php (modified) (3 diffs)
-
app/Plugin.php (modified) (5 diffs)
-
app/Shortcodes/LinkButton.php (added)
-
app/Widgets/Button.php (modified) (10 diffs)
-
ethpress.php (modified) (1 diff)
-
languages/ethpress.pot (modified) (8 diffs)
-
readme.txt (modified) (4 diffs)
-
vendor/autoload.php (modified) (1 diff)
-
vendor/composer/autoload_classmap.php (modified) (1 diff)
-
vendor/composer/autoload_real.php (modified) (3 diffs)
-
vendor/composer/autoload_static.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ethpress/trunk/app/Admin/Options.php
r2763568 r2775563 224 224 self::input_api_url( $options ); 225 225 self::input_use_managed_service( $options ); 226 self::input_redirect_url( $options ); 226 227 self::section_login(); 227 228 self::woocommerce_login_form_setting( $options ); 228 229 self::woocommerce_register_form_setting( $options ); 229 230 self::woocommerce_after_checkout_registration_form_setting( $options ); 231 self::woocommerce_account_details_link_button_setting( $options ); 232 self::section_strings(); 233 self::login_button_label_setting( $options ); 234 self::link_button_label_setting( $options ); 235 self::register_button_label_setting( $options ); 230 236 } 231 237 … … 318 324 319 325 /** 326 * Outputs login section title. 327 * 328 * @since 1.2.0 329 */ 330 public static function section_strings() 331 { 332 ?> 333 <tr valign="top"> 334 <th scope="row"> 335 <h2> 336 <?php 337 _e( "Labels Settings", 'ethpress' ); 338 ?> 339 </h2> 340 </th> 341 <td> 342 </td> 343 </tr> 344 <?php 345 } 346 347 /** 348 * Outputs input for login_button_label option. 349 * 350 * @since 1.5.12 351 */ 352 public static function login_button_label_setting( $options = null ) 353 { 354 $login_button_label = ( isset( $options['login_button_label'] ) ? esc_attr( $options['login_button_label'] ) : esc_html__( 'Log In With a Crypto Wallet', 'ethpress' ) ); 355 ?> 356 <tr valign="top"> 357 <th scope="row"><?php 358 _e( "Login button label", 'ethpress' ); 359 ?></th> 360 <td> 361 <fieldset> 362 <label> 363 <input <?php 364 if ( \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 365 if ( !\losnappas\Ethpress\ethpress_fs()->is_trial() ) { 366 ?> disabled <?php 367 } 368 } 369 ?> class="regular-text" id="ethpress_login_button_label" name="ethpress[login_button_label]" type="text" value="<?php 370 echo esc_attr( $login_button_label ) ; 371 ?>"> 372 <p class="description"> 373 <?php 374 _e( 'The Login button text can be set there.' ); 375 ?></p> 376 <?php 377 if ( \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 378 379 if ( \losnappas\Ethpress\ethpress_fs()->is_trial() ) { 380 ?> 381 <h2 class="description"><?php 382 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using this feature!', 'ethpress' ) . '</a>' ; 383 ?></h2> 384 <?php 385 } else { 386 ?> 387 <h2 class="description"><?php 388 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use this feature!', 'ethpress' ) . '</a>' ; 389 ?></h2> 390 <?php 391 } 392 393 } 394 ?> 395 </label> 396 </fieldset> 397 </td> 398 </tr> 399 <?php 400 } 401 402 /** 403 * Outputs input for link_button_label option. 404 * 405 * @since 1.5.12 406 */ 407 public static function link_button_label_setting( $options = null ) 408 { 409 $link_button_label = ( isset( $options['link_button_label'] ) ? esc_attr( $options['link_button_label'] ) : esc_html__( 'Link Your Crypto Wallets', 'ethpress' ) ); 410 ?> 411 <tr valign="top"> 412 <th scope="row"><?php 413 _e( "Link button label", 'ethpress' ); 414 ?></th> 415 <td> 416 <fieldset> 417 <label> 418 <input <?php 419 if ( \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 420 if ( !\losnappas\Ethpress\ethpress_fs()->is_trial() ) { 421 ?> disabled <?php 422 } 423 } 424 ?> class="regular-text" id="ethpress_link_button_label" name="ethpress[link_button_label]" type="text" value="<?php 425 echo esc_attr( $link_button_label ) ; 426 ?>"> 427 <p class="description"> 428 <?php 429 _e( 'The Link button text can be set there.' ); 430 ?></p> 431 <?php 432 if ( \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 433 434 if ( \losnappas\Ethpress\ethpress_fs()->is_trial() ) { 435 ?> 436 <h2 class="description"><?php 437 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using this feature!', 'ethpress' ) . '</a>' ; 438 ?></h2> 439 <?php 440 } else { 441 ?> 442 <h2 class="description"><?php 443 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use this feature!', 'ethpress' ) . '</a>' ; 444 ?></h2> 445 <?php 446 } 447 448 } 449 ?> 450 </label> 451 </fieldset> 452 </td> 453 </tr> 454 <?php 455 } 456 457 /** 458 * Outputs input for register_button_label option. 459 * 460 * @since 1.5.12 461 */ 462 public static function register_button_label_setting( $options = null ) 463 { 464 $register_button_label = ( isset( $options['register_button_label'] ) ? esc_attr( $options['register_button_label'] ) : esc_html__( 'Register With a Crypto Wallet', 'ethpress' ) ); 465 ?> 466 <tr valign="top"> 467 <th scope="row"><?php 468 _e( "Link button label", 'ethpress' ); 469 ?></th> 470 <td> 471 <fieldset> 472 <label> 473 <input <?php 474 if ( \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 475 if ( !\losnappas\Ethpress\ethpress_fs()->is_trial() ) { 476 ?> disabled <?php 477 } 478 } 479 ?> class="regular-text" id="ethpress_register_button_label" name="ethpress[register_button_label]" type="text" value="<?php 480 echo esc_attr( $register_button_label ) ; 481 ?>"> 482 <p class="description"> 483 <?php 484 _e( 'The Link button text can be set there.' ); 485 ?></p> 486 <?php 487 if ( \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 488 489 if ( \losnappas\Ethpress\ethpress_fs()->is_trial() ) { 490 ?> 491 <h2 class="description"><?php 492 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using this feature!', 'ethpress' ) . '</a>' ; 493 ?></h2> 494 <?php 495 } else { 496 ?> 497 <h2 class="description"><?php 498 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use this feature!', 'ethpress' ) . '</a>' ; 499 ?></h2> 500 <?php 501 } 502 503 } 504 ?> 505 </label> 506 </fieldset> 507 </td> 508 </tr> 509 <?php 510 } 511 512 /** 320 513 * Outputs input for api url option. 321 514 * … … 333 526 <tr valign="top"> 334 527 <th scope="row"><?php 335 _e( " WooCommerce Login Form", 'ethpress' );528 _e( "Verification Service API URL", 'ethpress' ); 336 529 ?></th> 337 530 <td> … … 394 587 395 588 /** 589 * Outputs input for redirect url option. 590 * 591 * @since 1.5.12 592 */ 593 public static function input_redirect_url( $options = null ) 594 { 595 $ecrecovers_with_php = self::_check_ecrecovers_with_php(); 596 if ( is_null( $options ) ) { 597 $options = get_site_option( 'ethpress' ); 598 } 599 // Logger::log("Options::input_redirect_url: options = " . print_r($options, true)); 600 $redirect_url = ( isset( $options['redirect_url'] ) ? esc_url( $options['redirect_url'] ) : '' ); 601 ?> 602 <tr valign="top"> 603 <th scope="row"><?php 604 _e( "Redirect URL", 'ethpress' ); 605 ?></th> 606 <td> 607 <fieldset> 608 <label> 609 <input <?php 610 if ( \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 611 if ( !\losnappas\Ethpress\ethpress_fs()->is_trial() ) { 612 ?> disabled <?php 613 } 614 } 615 ?> class="regular-text" id="ethpress_redirect_url" name="ethpress[redirect_url]" type="text" value="<?php 616 echo esc_attr( $redirect_url ) ; 617 ?>"> 618 <p class="description"> 619 <?php 620 _e( 'The page to redirect after a successful login', 'ethpress' ); 621 ?></p> 622 <?php 623 if ( \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 624 625 if ( \losnappas\Ethpress\ethpress_fs()->is_trial() ) { 626 ?> 627 <h2 class="description"><?php 628 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using this feature!', 'ethpress' ) . '</a>' ; 629 ?></h2> 630 <?php 631 } else { 632 ?> 633 <h2 class="description"><?php 634 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use this feature!', 'ethpress' ) . '</a>' ; 635 ?></h2> 636 <?php 637 } 638 639 } 640 ?> 641 </label> 642 </fieldset> 643 </td> 644 </tr> 645 <?php 646 } 647 648 /** 396 649 * Outputs input for use_managed_service option. 397 650 * … … 449 702 ?> 450 703 <h2 class="description"><?php 451 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using th e Managed Verification Service APIfeature!', 'ethpress' ) . '</a>' ;704 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using this feature!', 'ethpress' ) . '</a>' ; 452 705 ?></h2> 453 706 <?php … … 455 708 ?> 456 709 <h2 class="description"><?php 457 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use th e Managed Verification Service APIfeature!', 'ethpress' ) . '</a>' ;710 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use this feature!', 'ethpress' ) . '</a>' ; 458 711 ?></h2> 459 712 <?php … … 520 773 ?> 521 774 <h2 class="description"><?php 522 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using th e WooCommerce Login Formfeature!', 'ethpress' ) . '</a>' ;775 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using this feature!', 'ethpress' ) . '</a>' ; 523 776 ?></h2> 524 777 <?php … … 526 779 ?> 527 780 <h2 class="description"><?php 528 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use th e WooCommerce Login Formfeature!', 'ethpress' ) . '</a>' ;781 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use this feature!', 'ethpress' ) . '</a>' ; 529 782 ?></h2> 530 783 <?php … … 596 849 ?> 597 850 <h2 class="description"><?php 598 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using th e WooCommerce Register Formfeature!', 'ethpress' ) . '</a>' ;851 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using this feature!', 'ethpress' ) . '</a>' ; 599 852 ?></h2> 600 853 <?php … … 602 855 ?> 603 856 <h2 class="description"><?php 604 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use th e WooCommerce Register Formfeature!', 'ethpress' ) . '</a>' ;857 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use this feature!', 'ethpress' ) . '</a>' ; 605 858 ?></h2> 606 859 <?php … … 681 934 ?> 682 935 <h2 class="description"><?php 683 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using th e WooCommerce Register on a Checkout pagefeature!', 'ethpress' ) . '</a>' ;936 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using this feature!', 'ethpress' ) . '</a>' ; 684 937 ?></h2> 685 938 <?php … … 687 940 ?> 688 941 <h2 class="description"><?php 689 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use th e WooCommerce Register on a Checkout pagefeature!', 'ethpress' ) . '</a>' ;942 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use this feature!', 'ethpress' ) . '</a>' ; 690 943 ?></h2> 691 944 <?php … … 707 960 <h2 class="description"><?php 708 961 echo '<a href="' . get_admin_url() . 'options-general.php' . '">' . __( 'Check the Administration > Settings > General > Membership: Anyone can register box to use this feature.', 'ethpress' ) . '</a> ' ; 962 ?></h2> 963 <?php 964 } 965 966 ?> 967 </fieldset> 968 </td> 969 </tr> 970 <?php 971 } 972 973 /** 974 * Outputs input for woocommerce_account_details_link_button_show option. 975 * 976 * @since 1.3.0 977 */ 978 public static function woocommerce_account_details_link_button_setting( $options = null ) 979 { 980 if ( is_null( $options ) ) { 981 $options = get_site_option( 'ethpress' ); 982 } 983 // Logger::log("Options::woocommerce_after_checkout_registration_form_setting: options = " . print_r($options, true)); 984 $woocommerce_account_details_link_button_show = false; 985 /** 986 * Check if WooCommerce is active 987 * https://wordpress.stackexchange.com/a/193908/137915 988 **/ 989 $woocommerce_active = in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ); 990 ?> 991 <tr valign="top"> 992 <th scope="row"><?php 993 _e( "WooCommerce Account Details Link Wallet Form", 'ethpress' ); 994 ?></th> 995 <td> 996 <fieldset> 997 <input <?php 998 if ( !get_option( 'users_can_register' ) || !$woocommerce_active || \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 999 if ( !get_option( 'users_can_register' ) || !$woocommerce_active || !\losnappas\Ethpress\ethpress_fs()->is_trial() ) { 1000 ?> disabled <?php 1001 } 1002 } 1003 ?> class="regular-text" id="ethpress_woocommerce_account_details_link_button_show" name="ethpress[woocommerce_account_details_link_button_show]" type="checkbox" value="yes" <?php 1004 echo ( $woocommerce_account_details_link_button_show ? 'checked' : '' ) ; 1005 ?> /> 1006 <label for="ethpress_woocommerce_account_details_link_button_show"> 1007 <?php 1008 _e( 'Show the Link Wallet button on the WooCommerce Account Details page?', 'ethpress' ); 1009 ?> 1010 </label> 1011 <p class="description"> 1012 <?php 1013 _e( 'Check to the Link Wallet button on the WooCommerce Account Details page.', 'ethpress' ); 1014 ?></p> 1015 <?php 1016 if ( \losnappas\Ethpress\ethpress_fs()->is_not_paying() ) { 1017 1018 if ( \losnappas\Ethpress\ethpress_fs()->is_trial() ) { 1019 ?> 1020 <h2 class="description"><?php 1021 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to keep using this feature!', 'ethpress' ) . '</a>' ; 1022 ?></h2> 1023 <?php 1024 } else { 1025 ?> 1026 <h2 class="description"><?php 1027 echo '<a href="' . \losnappas\Ethpress\ethpress_fs()->get_upgrade_url() . '">' . __( 'Upgrade to use this feature!', 'ethpress' ) . '</a>' ; 1028 ?></h2> 1029 <?php 1030 } 1031 1032 } 1033 1034 if ( !$woocommerce_active ) { 1035 ?> 1036 <h2 class="description"><?php 1037 echo '<a href="https://woocommerce.com/?aff=12943&cid=17113767">' . __( 'Install WooCommerce to use this feature!', 'ethpress' ) . '</a> ' . __( 'WooCommerce is a customizable, open-source eCommerce platform built on WordPress.', 'ethpress' ) ; 709 1038 ?></h2> 710 1039 <?php … … 737 1066 $woocommerce_register_form_show = false; 738 1067 $woocommerce_after_checkout_registration_form_show = false; 1068 $woocommerce_account_details_link_button_show = false; 1069 $login_button_label = ''; 1070 $link_button_label = ''; 1071 $register_button_label = ''; 1072 $redirect_url = ''; 739 1073 if ( empty($input['recursive']) && is_multisite() ) { 740 1074 // Mark next call as recursed. … … 742 1076 } 743 1077 $options['api_url'] = $newurl; 1078 $options['redirect_url'] = $redirect_url; 744 1079 $options['use_managed_service'] = intval( $use_managed_service ); 745 1080 $options['woocommerce_login_form_show'] = intval( $woocommerce_login_form_show ); 746 1081 $options['woocommerce_register_form_show'] = intval( $woocommerce_register_form_show ); 747 1082 $options['woocommerce_after_checkout_registration_form_show'] = intval( $woocommerce_after_checkout_registration_form_show ); 1083 $options['woocommerce_account_details_link_button_show'] = intval( $woocommerce_account_details_link_button_show ); 1084 $options['login_button_label'] = $login_button_label; 1085 $options['link_button_label'] = $link_button_label; 1086 $options['register_button_label'] = $register_button_label; 748 1087 if ( isset( $input['have_db_users'] ) ) { 749 1088 $options['have_db_users'] = $input['have_db_users']; -
ethpress/trunk/app/Dependencies/BN/BN.php
r2275868 r2775563 93 93 } 94 94 95 #[\ReturnTypeWillChange] 95 96 public function jsonSerialize() { 96 97 return $this->toString(16); -
ethpress/trunk/app/Front.php
r2664122 r2775563 1 1 <?php 2 2 3 /** 3 4 * Handles front-end. … … 6 7 * @package ethpress 7 8 */ 8 9 9 namespace losnappas\Ethpress; 10 10 11 11 defined( 'ABSPATH' ) || die; 12 13 use \losnappas\Ethpress\Plugin; 14 12 use losnappas\Ethpress\Plugin ; 15 13 /** 16 14 * Handles functions for frontend. … … 18 16 * @since 0.1.0 19 17 */ 20 class Front { 18 class Front 19 { 20 /** 21 * Displays login button. Hooked to login_form. 22 * 23 * @since 0.1.0 24 */ 25 public static function login_form() 26 { 27 $text = esc_html__( 'Enable JavaScript to log in with a crypto wallet.', 'ethpress' ); 28 $noscript = '<noscript>' . $text . '</noscript>'; 29 // phpcs:disable -- Complains about not being escaped. They are. 30 echo $noscript ; 31 ?> 32 <div class="ethpress"> 33 <?php 34 echo self::get_login_button() ; 35 ?> 36 </div> 37 <?php 38 // phpcs:enable 39 } 40 41 /** 42 * Gets the login form. 43 * 44 * @since 0.1.1 45 */ 46 public static function get_login_form() 47 { 48 \ob_start(); 49 self::login_form(); 50 return \ob_get_clean(); 51 } 52 53 /** 54 * Creates necessary html for the login button. 55 * 56 * @since 0.1.0 57 * 58 * @return string Login button html. 59 */ 60 public static function get_login_button() 61 { 62 \ob_start(); 63 self::login_button(); 64 return \ob_get_clean(); 65 } 66 67 /** 68 * Creates necessary html for the login button. 69 * 70 * @since 0.1.0 71 * 72 * @return string Login button html. 73 */ 74 public static function login_button() 75 { 76 $label = esc_html__( 'Log In With a Crypto Wallet', 'ethpress' ); 77 ?> 78 <button class="ethpress-metamask-login-button ethpress-button ethpress-button-secondary ethpress-button-large" type="button" name="metamask"> 79 <?php 80 echo $label ; 81 ?> 82 </button> 83 <?php 84 } 85 86 /** 87 * Creates necessary html for the link button. 88 * 89 * @since 1.5.12 90 * 91 * @return string Link button html. 92 */ 93 public static function get_link_button() 94 { 95 \ob_start(); 96 self::link_button(); 97 return \ob_get_clean(); 98 } 99 100 /** 101 * Creates necessary html for the link button. 102 * 103 * @since 1.5.12 104 * 105 * @return void 106 */ 107 public static function link_button() 108 { 109 Plugin::login_enqueue_scripts(); 110 $is_user_logged_in = is_user_logged_in(); 111 112 if ( !$is_user_logged_in ) { 113 Front::login_form(); 114 } else { 115 $label = esc_html__( 'Link Your Crypto Wallets', 'ethpress' ); 116 ?> 117 <button class='ethpress-metamask-login-button ethpress-button ethpress-button-secondary ethpress-button-large ethpress-account-linker-button' type='button' name='metamask'> 118 <?php 119 echo $label ; 120 ?> 121 </button> 122 <?php 123 } 124 125 } 126 127 /** 128 * Displays register button. Hooked to register_form. 129 * 130 * @since 0.1.0 131 */ 132 public static function register_form() 133 { 134 $text = esc_html__( 'Enable JavaScript to log in with a crypto wallet.', 'ethpress' ); 135 $noscript = '<noscript>' . $text . '</noscript>'; 136 // phpcs:disable -- Complains about not being escaped. They are. 137 echo $noscript ; 138 ?> 139 <div class="ethpress"> 140 <?php 141 echo self::get_register_button() ; 142 ?> 143 </div> 144 <?php 145 // phpcs:enable 146 } 147 148 /** 149 * Gets the register form. 150 * 151 * @since 0.1.1 152 */ 153 public static function get_register_form() 154 { 155 \ob_start(); 156 self::register_form(); 157 return \ob_get_clean(); 158 } 159 160 /** 161 * Creates necessary html for the register button. 162 * 163 * @since 0.1.0 164 * 165 * @return string Register button html. 166 */ 167 public static function get_register_button() 168 { 169 \ob_start(); 170 self::register_button(); 171 return \ob_get_clean(); 172 } 173 174 /** 175 * Creates necessary html for the login button. 176 * 177 * @since 0.1.0 178 * 179 * @return string Login button html. 180 */ 181 public static function register_button() 182 { 183 $label = esc_html__( 'Register With a Crypto Wallet', 'ethpress' ); 184 ?> 185 <button class="ethpress-metamask-login-button ethpress-button ethpress-button-secondary ethpress-button-large" type="button" name="metamask"> 186 <?php 187 echo $label ; 188 ?> 189 </button> 190 <?php 191 } 21 192 22 /**23 * Displays login button. Hooked to login_form.24 *25 * @since 0.1.026 */27 public static function login_form() {28 $text = esc_html__( 'Enable JavaScript to log in with a crypto wallet.', 'ethpress' );29 $noscript = '<noscript>' . $text . '</noscript>';30 31 // phpcs:disable -- Complains about not being escaped. They are.32 echo $noscript;33 ?>34 <div class="ethpress">35 <?php echo self::get_login_button(); ?>36 </div>37 <?php38 // phpcs:enable39 }40 41 /**42 * Gets the login form.43 *44 * @since 0.1.145 */46 public static function get_login_form() {47 \ob_start();48 self::login_form();49 return \ob_get_clean();50 }51 52 /**53 * Creates necessary html for the login button.54 *55 * @since 0.1.056 *57 * @return string Login button html.58 */59 public static function get_login_button() {60 $label = esc_html__( 'Log In With a Crypto Wallet', 'ethpress' );61 $button = "62 <button class='ethpress-metamask-login-button ethpress-button ethpress-button-secondary ethpress-button-large' type='button' name='metamask'>63 $label64 </button>";65 return $button;66 }67 68 /**69 * Displays register button. Hooked to register_form.70 *71 * @since 0.1.072 */73 public static function register_form() {74 $text = esc_html__( 'Enable JavaScript to log in with a crypto wallet.', 'ethpress' );75 $noscript = '<noscript>' . $text . '</noscript>';76 77 // phpcs:disable -- Complains about not being escaped. They are.78 echo $noscript;79 ?>80 <div class="ethpress">81 <?php echo self::get_register_button(); ?>82 </div>83 <?php84 // phpcs:enable85 }86 87 /**88 * Gets the register form.89 *90 * @since 0.1.191 */92 public static function get_register_form() {93 \ob_start();94 self::register_form();95 return \ob_get_clean();96 }97 98 /**99 * Creates necessary html for the register button.100 *101 * @since 0.1.0102 *103 * @return string Register button html.104 */105 public static function get_register_button() {106 $label = esc_html__( 'Register With a Crypto Wallet', 'ethpress' );107 $button = "108 <button class='ethpress-metamask-login-button ethpress-button ethpress-button-secondary ethpress-button-large' type='button' name='metamask'>109 $label110 </button>";111 return $button;112 }113 193 } -
ethpress/trunk/app/Login.php
r2754355 r2775563 1 1 <?php 2 2 3 /** 3 4 * Controls login flow. … … 6 7 * @since 0.1.0 7 8 */ 8 9 9 namespace losnappas\Ethpress; 10 10 11 11 defined( 'ABSPATH' ) || die; 12 13 use losnappas\Ethpress\Address; 14 use losnappas\Ethpress\Signature; 15 use losnappas\Ethpress\Nonce; 12 use losnappas\Ethpress\Address ; 13 use losnappas\Ethpress\Signature ; 14 use losnappas\Ethpress\Nonce ; 16 15 /** 17 16 * In php, wp_enqueue_script( 'ethpress-login' ); and then you can call ethpress.metamask.connect in javascript. … … 19 18 * @since 0.1.0 20 19 */ 21 class Login { 22 23 /** 24 * Ajax: verifies signed message by re-creating the message again and extracting the address. 25 * 26 * @since 0.1.0 27 */ 28 public static function verify_login() { 29 check_ajax_referer( 'ethpress_log_in' ); 30 31 $message = ''; 32 $success = true; 33 34 if ( ! isset( $_POST['coinbase'], $_POST['signature'] ) ) { 35 wp_send_json_error( [ 'message' => esc_html__( 'Invalid input', 'ethpress' ) ] ); 36 } 37 38 // Sanitize. 39 // These two show up as linter errors, but that is a bug in the linter itself. 40 $coinbase = Address::sanitize( wp_unslash( $_POST['coinbase'] ) ); 41 $signature = Address::sanitize( wp_unslash( $_POST['signature'] ) ); 42 $requested_redirect_to = ''; 43 if ( ! empty( $_POST['redirect_to'] ) ) { 44 $redirect_to = wp_sanitize_redirect( wp_unslash( $_POST['redirect_to'] ) ); 45 $requested_redirect_to = $redirect_to; 46 } else { 47 $redirect_to = admin_url(); 48 } 49 50 // Verify. 51 $message = self::get_login_message( $coinbase ); 52 $verified = Signature::verify( $message, $signature, $coinbase ); 53 54 if ( $verified ) { 55 // Log in. 56 try { 57 $address = new Address( $coinbase ); 58 if ( get_option( 'users_can_register' ) ) { 59 $user = $address->register_and_log_in(); 60 } else { 61 $user = $address->log_in(); 62 } 63 $message = esc_html__( 'Logged in', 'ethpress' ); 64 // phpcs:ignore -- This is using wp original hook. 65 $redirect_to = apply_filters( 'login_redirect', $redirect_to, $requested_redirect_to, $user ); 66 } catch ( \WP_Error $e ) { 67 $user = $e; 68 } 69 } else { 70 $user = new \WP_Error( 'ethpress', __( 'Signature err, try again.', 'ethpress' ) ); 71 } 72 73 if ( isset( $_POST['provider'] ) ) { 74 $provider = \sanitize_key( \wp_unslash( (string) $_POST['provider'] ) ); 75 } else { 76 $provider = false; 77 } 78 79 /** 80 * Fires after every login attempt. 81 * 82 * @since 0.1.0 83 * 84 * @param WP_User|WP_Error $user WP_User on success, WP_Error on failure. 85 * @param (string|false) $provider One of 'metamask', 'walletconnect', false. 86 */ 87 do_action( 'ethpress_login', $user, $provider ); 88 89 if ( is_wp_error( $user ) ) { 90 $message = $user->get_error_message(); 91 $success = false; 92 } elseif ( ( empty( $redirect_to ) || 'wp-admin/' === $redirect_to || admin_url() === $redirect_to ) ) { 93 // Redirect. 94 // Copied from wp-login.php. 95 // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. 96 if ( is_multisite() && ! get_active_blog_for_user( $user->ID ) && ! is_super_admin( $user->ID ) ) { 97 $redirect_to = user_admin_url(); 98 } elseif ( is_multisite() && ! $user->has_cap( 'read' ) ) { 99 $redirect_to = get_dashboard_url( $user->ID ); 100 } elseif ( ! $user->has_cap( 'edit_posts' ) ) { 101 $redirect_to = $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url(); 102 } 103 } 104 105 wp_send_json( 106 [ 107 'data' => [ 108 'redirect' => $redirect_to, 109 'message' => $message, 110 ], 111 'success' => $success, 112 ] 113 ); 114 } 115 116 /** 117 * Gets login message to be signed for address. 118 * 119 * @since 0.1.0 120 * 121 * @param string $coinbase Address. 122 * @return string Message. 123 */ 124 public static function get_login_message( $coinbase ) { 125 $message = sprintf( 126 /* translators: blog name. */ 127 __( 128 'Log in to %1$s', 129 'ethpress' 130 ), 131 get_bloginfo( 'name', 'display' ) 132 ) . "\n\n" . get_home_url(); 133 $nonce = Nonce::get( $coinbase ); 134 135 /** 136 * Filters the message to show in the login dialog. 137 * 138 * The message needs to be the same when it is signed and when it is verified. 139 * Nonce will be added on a new line. 140 * 141 * @since 0.1.0 142 * @since 0.7.0 Has wallet address as 2nd argument: $coinbase. Client ip is now hashed with nonce. 143 * 144 * @param string $message Message. 145 * @param string $coinbase User's address. 146 */ 147 $message = apply_filters( 'ethpress_login_message', $message, $coinbase ); 148 $message .= "\n\n" . $nonce; 149 return $message; 150 } 151 152 /** 153 * Ajax: sends login message. Used to use GET, but now using POST, thus using _REQUEST. 154 * 155 * @since 0.1.0 156 */ 157 public static function get_message() { 158 $referer_ok = check_ajax_referer( 'ethpress_get_message', false, false ); 159 if ( ! $referer_ok ) { 160 // User had probably logged in without cookies enabled. 161 wp_send_json_error( esc_html__( 'Bad nonce, please refresh.', 'ethpress' ) ); 162 } elseif ( ! empty( $_REQUEST['coinbase'] ) ) { 163 // This shows up as lint error, but that is a bug in the linter itself. 164 $coinbase = Address::sanitize( wp_unslash( $_REQUEST['coinbase'] ) ); 165 $message = self::get_login_message( $coinbase ); 166 wp_send_json_success( $message ); 167 } else { 168 wp_send_json_error( esc_html__( 'No address specified.', 'ethpress' ) ); 169 } 170 } 171 172 /** 173 * Deletes table row when user is deleted. 174 * 175 * @since 0.1.0 176 * 177 * @param int $user_id Id of the user being deleted. 178 */ 179 public static function destroy( $user_id ) { 180 $address = Address::find_by_user( $user_id ); 181 if ( ! is_wp_error( $address ) ) { 182 $address->delete(); 183 } 184 /** 185 * Fires after address table row was attempted deleted. 186 * 187 * @since 0.1.0 188 * 189 * @param int $user_id User id of address that was attempted deleted. 190 * @param Address|WP_Error $address Address if deletiong success, WP_Error otherwise. 191 */ 192 do_action( 'ethpress_destroyed', $user_id, $address ); 193 } 194 195 /** 196 * Attaches user to blog. 197 * 198 * @since 0.2.4 199 * 200 * @param WP_User $user User to add. 201 * @return true|void|\WP_Error True if success. Nothing if not multisite. WP_Error if error. 202 */ 203 public static function attach_user_to_blog( $user ) { 204 if ( ! empty( $user ) && ! is_wp_error( $user ) && is_multisite() ) { 205 $blog_id = get_current_blog_id(); 206 $existing_user_id = $user->ID; 207 if ( ! is_user_member_of_blog( $existing_user_id, $blog_id ) ) { 208 20 class Login 21 { 22 /** 23 * Ajax: verifies signed message by re-creating the message again and extracting the address. 24 * 25 * @since 0.1.0 26 */ 27 public static function verify_login() 28 { 29 check_ajax_referer( 'ethpress_log_in' ); 30 $message = ''; 31 $success = true; 32 if ( !isset( $_POST['coinbase'], $_POST['signature'] ) ) { 33 wp_send_json_error( [ 34 'message' => esc_html__( 'Invalid input', 'ethpress' ), 35 ] ); 36 } 37 // Sanitize. 38 // These two show up as linter errors, but that is a bug in the linter itself. 39 $coinbase = Address::sanitize( wp_unslash( $_POST['coinbase'] ) ); 40 $signature = Address::sanitize( wp_unslash( $_POST['signature'] ) ); 41 $requested_redirect_to = ''; 42 43 if ( !empty($_POST['redirect_to']) ) { 44 $redirect_to = wp_sanitize_redirect( wp_unslash( $_POST['redirect_to'] ) ); 45 $requested_redirect_to = $redirect_to; 46 } else { 47 $redirect_to = admin_url(); 48 } 49 50 // Verify. 51 $message = self::get_login_message( $coinbase ); 52 $verified = Signature::verify( $message, $signature, $coinbase ); 53 54 if ( $verified ) { 55 // Log in. 56 try { 57 $address = new Address( $coinbase ); 58 59 if ( get_option( 'users_can_register' ) ) { 60 $user = $address->register_and_log_in(); 61 } else { 62 $user = $address->log_in(); 63 } 64 65 $message = esc_html__( 'Logged in', 'ethpress' ); 66 // phpcs:ignore -- This is using wp original hook. 67 $redirect_to = apply_filters( 68 'login_redirect', 69 $redirect_to, 70 $requested_redirect_to, 71 $user 72 ); 73 } catch ( \WP_Error $e ) { 74 $user = $e; 75 } 76 } else { 77 $user = new \WP_Error( 'ethpress', __( 'Signature err, try again.', 'ethpress' ) ); 78 } 79 80 81 if ( isset( $_POST['provider'] ) ) { 82 $provider = \sanitize_key( \wp_unslash( (string) $_POST['provider'] ) ); 83 } else { 84 $provider = false; 85 } 86 87 /** 88 * Fires after every login attempt. 89 * 90 * @since 0.1.0 91 * 92 * @param \WP_User|\WP_Error $user WP_User on success, WP_Error on failure. 93 * @param (string|false) $provider One of 'metamask', 'walletconnect', false. 94 */ 95 do_action( 'ethpress_login', $user, $provider ); 96 97 if ( is_wp_error( $user ) ) { 98 $message = $user->get_error_message(); 99 $success = false; 100 } elseif ( empty($redirect_to) || 'wp-admin/' === $redirect_to || admin_url() === $redirect_to ) { 101 /** 102 * @var \WP_User 103 */ 104 $user = $user; 105 // Redirect. 106 // Copied from wp-login.php. 107 // If the user doesn't belong to a blog, send them to user admin. If the user can't edit posts, send them to their profile. 108 109 if ( is_multisite() && !get_active_blog_for_user( $user->ID ) && !is_super_admin( $user->ID ) ) { 110 $redirect_to = user_admin_url(); 111 } elseif ( is_multisite() && !$user->has_cap( 'read' ) ) { 112 $redirect_to = get_dashboard_url( $user->ID ); 113 } elseif ( !$user->has_cap( 'edit_posts' ) ) { 114 $redirect_to = ( $user->has_cap( 'read' ) ? admin_url( 'profile.php' ) : home_url() ); 115 } 116 117 } 118 119 wp_send_json( [ 120 'data' => [ 121 'redirect' => $redirect_to, 122 'message' => $message, 123 ], 124 'success' => $success, 125 ] ); 126 } 127 128 /** 129 * Gets login message to be signed for address. 130 * 131 * @since 0.1.0 132 * 133 * @param string $coinbase Address. 134 * @return string Message. 135 */ 136 public static function get_login_message( $coinbase ) 137 { 138 $message = sprintf( 139 /* translators: blog name. */ 140 __( 'Log in to %1$s', 'ethpress' ), 141 get_bloginfo( 'name', 'display' ) 142 ) . "\n\n" . get_home_url(); 143 $nonce = Nonce::get( $coinbase ); 144 /** 145 * Filters the message to show in the login dialog. 146 * 147 * The message needs to be the same when it is signed and when it is verified. 148 * Nonce will be added on a new line. 149 * 150 * @since 0.1.0 151 * @since 0.7.0 Has wallet address as 2nd argument: $coinbase. Client ip is now hashed with nonce. 152 * 153 * @param string $message Message. 154 * @param string $coinbase User's address. 155 */ 156 $message = apply_filters( 'ethpress_login_message', $message, $coinbase ); 157 $message .= "\n\n" . $nonce; 158 return $message; 159 } 160 161 /** 162 * Ajax: sends login message. Used to use GET, but now using POST, thus using _REQUEST. 163 * 164 * @since 0.1.0 165 */ 166 public static function get_message() 167 { 168 $referer_ok = check_ajax_referer( 'ethpress_get_message', false, false ); 169 170 if ( !$referer_ok ) { 171 // User had probably logged in without cookies enabled. 172 wp_send_json_error( esc_html__( 'Bad nonce, please refresh.', 'ethpress' ) ); 173 } elseif ( !empty($_REQUEST['coinbase']) ) { 174 // This shows up as lint error, but that is a bug in the linter itself. 175 $coinbase = Address::sanitize( wp_unslash( $_REQUEST['coinbase'] ) ); 176 $message = self::get_login_message( $coinbase ); 177 wp_send_json_success( $message ); 178 } else { 179 wp_send_json_error( esc_html__( 'No address specified.', 'ethpress' ) ); 180 } 181 182 } 183 184 /** 185 * Deletes table row when user is deleted. 186 * 187 * @since 0.1.0 188 * 189 * @param int $user_id Id of the user being deleted. 190 */ 191 public static function destroy( $user_id ) 192 { 193 $address = Address::find_by_user( $user_id ); 194 if ( !is_wp_error( $address ) ) { 195 $address->delete(); 196 } 197 /** 198 * Fires after address table row was attempted deleted. 199 * 200 * @since 0.1.0 201 * 202 * @param int $user_id User id of address that was attempted deleted. 203 * @param Address|WP_Error $address Address if deletiong success, WP_Error otherwise. 204 */ 205 do_action( 'ethpress_destroyed', $user_id, $address ); 206 } 207 208 /** 209 * Attaches user to blog. 210 * 211 * @since 0.2.4 212 * 213 * @param WP_User $user User to add. 214 * @return true|void|\WP_Error True if success. Nothing if not multisite. WP_Error if error. 215 */ 216 public static function attach_user_to_blog( $user ) 217 { 218 219 if ( !empty($user) && !is_wp_error( $user ) && is_multisite() ) { 220 $blog_id = get_current_blog_id(); 221 $existing_user_id = $user->ID; 222 223 if ( !is_user_member_of_blog( $existing_user_id, $blog_id ) ) { 209 224 // @see https://stackoverflow.com/a/12178249/4256005 210 $role = get_option( 'default_role');211 if ( empty($role)) {225 $role = get_option( 'default_role' ); 226 if ( empty($role) ) { 212 227 // https://wordpress.org/support/article/multisite-network-administration/ 213 // "By design, all users who are added to your network will have subscriber access to all sites on your network".228 // "By design, all users who are added to your network will have subscriber access to all sites on your network". 214 229 $role = 'subscriber'; 215 230 } 216 $result = add_user_to_blog( $blog_id, $existing_user_id, $role ); 217 218 return $result; 219 } 220 } 221 } 231 $result = add_user_to_blog( $blog_id, $existing_user_id, $role ); 232 return $result; 233 } 234 235 } 236 237 } 222 238 223 239 } -
ethpress/trunk/app/Plugin.php
r2763568 r2775563 12 12 use losnappas\Ethpress\Upgrade ; 13 13 use losnappas\Ethpress\Shortcodes\LoginButton ; 14 use losnappas\Ethpress\Shortcodes\LinkButton ; 14 15 use losnappas\Ethpress\Shortcodes\LoggedAccount ; 15 16 use losnappas\Ethpress\Logger ; … … 49 50 'woocommerce_register_form_show' => '0', 50 51 'woocommerce_after_checkout_registration_form_show' => '0', 52 'woocommerce_account_details_link_button_show' => '0', 51 53 ]; 52 54 $options = \get_site_option( 'ethpress', $defopts ); … … 68 70 add_action( 'ethpress_login', [ ETHPRESS_NS . '\\Login', 'attach_user_to_blog' ] ); 69 71 add_shortcode( LoginButton::$shortcode_name, [ ETHPRESS_NS . '\\Shortcodes\\LoginButton', 'add_shortcode' ] ); 72 add_shortcode( LinkButton::$shortcode_name, [ ETHPRESS_NS . '\\Shortcodes\\LinkButton', 'add_shortcode' ] ); 70 73 add_action( 'widgets_init', [ ETHPRESS_NS . '\\Widgets\\Button', 'widgets_init' ] ); 71 74 add_action( 'show_user_profile', [ ETHPRESS_NS . '\\Widgets\\Button', 'show_user_profile' ] ); … … 245 248 $woocommerce_register_form_show = false; 246 249 $woocommerce_after_checkout_registration_form_show = false; 250 $woocommerce_account_details_link_button_show = false; 251 $login_button_label = ''; 252 $link_button_label = ''; 253 $register_button_label = ''; 254 $redirect_url = ''; 247 255 $opts = [ 248 256 'db_version' => $db_version, … … 251 259 'woocommerce_register_form_show' => $woocommerce_register_form_show, 252 260 'woocommerce_after_checkout_registration_form_show' => $woocommerce_after_checkout_registration_form_show, 261 'woocommerce_account_details_link_button_show' => $woocommerce_account_details_link_button_show, 262 'login_button_label' => $login_button_label, 263 'link_button_label' => $link_button_label, 264 'register_button_label' => $register_button_label, 265 'redirect_url' => $redirect_url, 253 266 ]; 254 267 /** -
ethpress/trunk/app/Widgets/Button.php
r2350902 r2775563 1 1 <?php 2 2 3 /** 3 4 * Ethpress widget: a button … … 8 9 namespace losnappas\Ethpress\Widgets; 9 10 10 defined( 'ABSPATH') || die;11 defined('ABSPATH') || die; 11 12 12 13 use losnappas\Ethpress\Plugin; … … 19 20 * @since 0.7.0 20 21 */ 21 class Button extends \WP_Widget { 22 class Button extends \WP_Widget 23 { 22 24 23 25 /** … … 26 28 * @since 0.7.0 27 29 */ 28 public function __construct() { 30 public function __construct() 31 { 29 32 $widget_ops = array( 30 33 'classname' => 'ethpress-widget', 31 'description' => esc_html__( 'EthPress Widget', 'ethpress'),34 'description' => esc_html__('EthPress Widget', 'ethpress'), 32 35 ); 33 parent::__construct( 'ethpress', esc_html__( 'EthPress', 'ethpress' ), $widget_ops);36 parent::__construct('ethpress', esc_html__('EthPress', 'ethpress'), $widget_ops); 34 37 } 35 38 … … 42 45 * @param array $instance Saved values from database. 43 46 */ 44 public function widget( $args, $instance ) { 47 public function widget($args, $instance) 48 { 45 49 $is_user_logged_in = is_user_logged_in(); 46 50 47 51 // This means it's going into admin dashboard. 48 if ( ! is_array( $args )) {52 if (!is_array($args)) { 49 53 $args = [ 50 54 'before_widget' => '<div class="ethpress" id="ethpress-dashboard-widget">', … … 57 61 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- These are supposed to be unescaped. 58 62 echo $args['before_widget']; 59 if ( ! empty( $instance['title'] )) {63 if (!empty($instance['title'])) { 60 64 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- These are supposed to be unescaped. 61 echo $args['before_title'] . apply_filters( 'widget_title', $instance['title']) . $args['after_title'];65 echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title']; 62 66 } 63 67 64 Plugin::login_enqueue_scripts(); 65 if ( ! $is_user_logged_in ) { 66 Front::login_form(); 67 } else { 68 ?> 69 <button class='ethpress-metamask-login-button ethpress-button ethpress-button-secondary ethpress-button-large ethpress-account-linker-button' type='button' name='metamask'> 70 <?php esc_html_e( 'Link Your Crypto Wallets', 'ethpress' ); ?> 71 </button> 72 <?php 73 } 68 Front::link_button(); 69 74 70 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- These are supposed to be unescaped. 75 71 echo $args['after_widget']; … … 81 77 * @param array $instance The widget options. 82 78 */ 83 public function form( $instance ) { 84 $title = ! empty( $instance['title'] ) ? $instance['title'] : ''; 85 ?> 79 public function form($instance) 80 { 81 $title = !empty($instance['title']) ? $instance['title'] : ''; 82 ?> 86 83 <p> 87 <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php esc_html_e( 'Title:', 'ethpress'); ?></label>88 <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>" name ="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $title); ?>">84 <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_html_e('Title:', 'ethpress'); ?></label> 85 <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>"> 89 86 </p> 90 <?php87 <?php 91 88 } 92 89 … … 101 98 * @return array 102 99 */ 103 public function update( $new_instance, $old_instance ) { 100 public function update($new_instance, $old_instance) 101 { 104 102 $instance = array(); 105 $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? sanitize_text_field( $new_instance['title']) : '';103 $instance['title'] = (!empty($new_instance['title'])) ? sanitize_text_field($new_instance['title']) : ''; 106 104 return $instance; 107 105 } … … 112 110 * @since 0.7.0 113 111 */ 114 public static function widgets_init() { 115 register_widget( ETHPRESS_NS . '\Widgets\Button' ); 112 public static function widgets_init() 113 { 114 register_widget(ETHPRESS_NS . '\Widgets\Button'); 116 115 117 116 global $pagenow; 118 117 $login_page = wp_login_url(); 119 $is_login_page = false !== stripos( $login_page, $pagenow);120 if ( isset( $_SERVER['SCRIPT_NAME'] )) {118 $is_login_page = false !== stripos($login_page, $pagenow); 119 if (isset($_SERVER['SCRIPT_NAME'])) { 121 120 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- we are simply comparing. 122 $is_login_page = $is_login_page || false !== stripos( $login_page, wp_unslash( $_SERVER['SCRIPT_NAME'] ));121 $is_login_page = $is_login_page || false !== stripos($login_page, wp_unslash($_SERVER['SCRIPT_NAME'])); 123 122 } 124 $ajax = defined( 'DOING_AJAX') && DOING_AJAX;125 if ( function_exists( 'wp_doing_ajax' )) {123 $ajax = defined('DOING_AJAX') && DOING_AJAX; 124 if (function_exists('wp_doing_ajax')) { 126 125 $ajax = wp_doing_ajax(); 127 126 } 128 if ( isset( $_SERVER['HTTP_REFERER'] ) && $ajax) {127 if (isset($_SERVER['HTTP_REFERER']) && $ajax) { 129 128 // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- we are simply comparing. 130 $is_login_page = $is_login_page || false !== stripos( wp_unslash( $_SERVER['HTTP_REFERER'] ), $login_page);129 $is_login_page = $is_login_page || false !== stripos(wp_unslash($_SERVER['HTTP_REFERER']), $login_page); 131 130 } 132 if ( ! $is_login_page && is_user_logged_in()) {133 add_action( 'wp_ajax_ethpress_link_account', [ ETHPRESS_NS . '\Linker', 'link_account' ]);134 add_filter( 'ethpress_login_message', [ ETHPRESS_NS . '\Linker', 'login_message' ]);131 if (!$is_login_page && is_user_logged_in()) { 132 add_action('wp_ajax_ethpress_link_account', [ETHPRESS_NS . '\Linker', 'link_account']); 133 add_filter('ethpress_login_message', [ETHPRESS_NS . '\Linker', 'login_message']); 135 134 add_filter( 136 135 'ethpress_login_inline_script', 137 [ ETHPRESS_NS . '\Linker', 'ethpress_login_inline_script']136 [ETHPRESS_NS . '\Linker', 'ethpress_login_inline_script'] 138 137 ); 139 138 } … … 145 144 * @since 0.7.0 146 145 */ 147 public static function show_user_profile() { 148 ?> 149 <h3><?php esc_html_e( 'Crypto Wallet', 'ethpress' ); ?></h3> 150 <p><?php esc_html_e( 'After linking a crypto wallet to your account, you can use it to log in.', 'ethpress' ); ?></p> 151 <?php 146 public static function show_user_profile() 147 { 148 ?> 149 <h3><?php esc_html_e('Crypto Wallet', 'ethpress'); ?></h3> 150 <p><?php esc_html_e('After linking a crypto wallet to your account, you can use it to log in.', 'ethpress'); ?></p> 151 <?php 152 152 self::widgets_init(); 153 153 $widget = new Button(); 154 $widget->widget( null, null);154 $widget->widget(null, null); 155 155 Plugin::register_scripts(); 156 156 Plugin::login_enqueue_scripts_and_styles(); 157 157 } 158 158 } 159 -
ethpress/trunk/ethpress.php
r2765503 r2775563 6 6 * Description: Ethereum Web3 login. Enable crypto wallet logins to WordPress. 7 7 * Author: Lynn (lynn.mvp at tutanota dot com), ethereumicoio 8 * Version: 1.5.1 18 * Version: 1.5.12 9 9 * Author URI: https://ethereumico.io 10 10 * Text Domain: ethpress -
ethpress/trunk/languages/ethpress.pot
r2765503 r2775563 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: EthPress 1.5.1 1\n"5 "Project-Id-Version: EthPress 1.5.12\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/ethpress\n" 7 "POT-Creation-Date: 2022-08- 03 05:10:43+00:00\n"7 "POT-Creation-Date: 2022-08-25 13:30:23+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=utf-8\n" … … 89 89 msgstr "" 90 90 91 #: app/Admin/Options.php:147 app/Admin/Options.php:2 3791 #: app/Admin/Options.php:147 app/Admin/Options.php:244 92 92 msgid "" 93 93 "If you like <strong>EthPress</strong> please leave us a %1$s rating. A huge " … … 107 107 msgstr "" 108 108 109 #: app/Admin/Options.php:2 28109 #: app/Admin/Options.php:235 110 110 msgid "Save Changes" 111 111 msgstr "" 112 112 113 #: app/Admin/Options.php:2 29113 #: app/Admin/Options.php:236 114 114 msgid "Are you sure you want to delete all EthPress options?" 115 115 msgstr "" 116 116 117 #: app/Admin/Options.php:2 29117 #: app/Admin/Options.php:236 118 118 msgid "Reset" 119 119 msgstr "" 120 120 121 #: app/Admin/Options.php:2 64121 #: app/Admin/Options.php:271 122 122 msgid "Main Settings" 123 123 msgstr "" 124 124 125 #: app/Admin/Options.php:2 84125 #: app/Admin/Options.php:291 126 126 msgid "Login Display Settings" 127 127 msgstr "" 128 128 129 #: app/Admin/Options.php:309 app/Admin/Options.php:469 130 msgid "WooCommerce Login Form" 131 msgstr "" 132 133 #: app/Admin/Options.php:315 app/Admin/Options.php:396 129 #: app/Admin/Options.php:311 130 msgid "Labels Settings" 131 msgstr "" 132 133 #: app/Admin/Options.php:327 app/Front.php:79 app/Plugin.php:313 134 msgid "Log In With a Crypto Wallet" 135 msgstr "" 136 137 #: app/Admin/Options.php:331 138 msgid "Login button label" 139 msgstr "" 140 141 #: app/Admin/Options.php:343 142 msgid "The Login button text can be set there." 143 msgstr "" 144 145 #: app/Admin/Options.php:348 app/Admin/Options.php:392 146 #: app/Admin/Options.php:436 app/Admin/Options.php:562 147 #: app/Admin/Options.php:632 app/Admin/Options.php:702 148 #: app/Admin/Options.php:774 app/Admin/Options.php:851 149 #: app/Admin/Options.php:928 150 msgid "Upgrade to keep using this feature!" 151 msgstr "" 152 153 #: app/Admin/Options.php:352 app/Admin/Options.php:396 154 #: app/Admin/Options.php:440 app/Admin/Options.php:566 155 #: app/Admin/Options.php:636 app/Admin/Options.php:706 156 #: app/Admin/Options.php:778 app/Admin/Options.php:855 157 #: app/Admin/Options.php:932 158 msgid "Upgrade to use this feature!" 159 msgstr "" 160 161 #: app/Admin/Options.php:371 app/Front.php:125 app/Plugin.php:314 162 msgid "Link Your Crypto Wallets" 163 msgstr "" 164 165 #: app/Admin/Options.php:375 app/Admin/Options.php:419 166 msgid "Link button label" 167 msgstr "" 168 169 #: app/Admin/Options.php:387 app/Admin/Options.php:431 170 msgid "The Link button text can be set there." 171 msgstr "" 172 173 #: app/Admin/Options.php:415 app/Front.php:199 app/Plugin.php:315 174 msgid "Register With a Crypto Wallet" 175 msgstr "" 176 177 #: app/Admin/Options.php:468 178 msgid "Verification Service API URL" 179 msgstr "" 180 181 #: app/Admin/Options.php:474 app/Admin/Options.php:607 134 182 msgid "" 135 183 "Your PHP installation has the necessary PHP extension to do verifications " … … 137 185 msgstr "" 138 186 139 #: app/Admin/Options.php: 326187 #: app/Admin/Options.php:485 140 188 msgid "" 141 189 "Use an API or install %1$sPHP-GMP%2$s or %3$sPHP-BCMath%2$s to verify " … … 143 191 msgstr "" 144 192 145 #: app/Admin/Options.php: 346193 #: app/Admin/Options.php:505 146 194 #. translators: a link. 147 195 msgid "To deploy your own verification service, see %1$s." 148 196 msgstr "" 149 197 150 #: app/Admin/Options.php:390 198 #: app/Admin/Options.php:542 199 msgid "Redirect URL" 200 msgstr "" 201 202 #: app/Admin/Options.php:554 203 msgid "The page to redirect after a successful login" 204 msgstr "" 205 206 #: app/Admin/Options.php:601 151 207 msgid "Managed Verification Service" 152 208 msgstr "" 153 209 154 #: app/Admin/Options.php: 410210 #: app/Admin/Options.php:621 155 211 msgid "Use Managed Verification Service" 156 212 msgstr "" 157 213 158 #: app/Admin/Options.php: 413214 #: app/Admin/Options.php:624 159 215 msgid "Check to use the Managed Verification Service." 160 216 msgstr "" 161 217 162 #: app/Admin/Options.php:421 163 msgid "Upgrade to keep using the Managed Verification Service API feature!" 164 msgstr "" 165 166 #: app/Admin/Options.php:425 167 msgid "Upgrade to use the Managed Verification Service API feature!" 168 msgstr "" 169 170 #: app/Admin/Options.php:480 218 #: app/Admin/Options.php:680 219 msgid "WooCommerce Login Form" 220 msgstr "" 221 222 #: app/Admin/Options.php:691 171 223 msgid "Show on WooCommerce Login Form?" 172 224 msgstr "" 173 225 174 #: app/Admin/Options.php: 483226 #: app/Admin/Options.php:694 175 227 msgid "Check to show EthPress login button on the WooCommerce Login Form." 176 228 msgstr "" 177 229 178 #: app/Admin/Options.php:491 179 msgid "Upgrade to keep using the WooCommerce Login Form feature!" 180 msgstr "" 181 182 #: app/Admin/Options.php:495 183 msgid "Upgrade to use the WooCommerce Login Form feature!" 184 msgstr "" 185 186 #: app/Admin/Options.php:501 app/Admin/Options.php:573 187 #: app/Admin/Options.php:650 230 #: app/Admin/Options.php:712 app/Admin/Options.php:784 231 #: app/Admin/Options.php:861 app/Admin/Options.php:938 188 232 msgid "Install WooCommerce to use this feature!" 189 233 msgstr "" 190 234 191 #: app/Admin/Options.php: 501 app/Admin/Options.php:573192 #: app/Admin/Options.php: 650235 #: app/Admin/Options.php:712 app/Admin/Options.php:784 236 #: app/Admin/Options.php:861 app/Admin/Options.php:938 193 237 msgid "" 194 238 "WooCommerce is a customizable, open-source eCommerce platform built on " … … 196 240 msgstr "" 197 241 198 #: app/Admin/Options.php: 541242 #: app/Admin/Options.php:752 199 243 msgid "WooCommerce Register Form" 200 244 msgstr "" 201 245 202 #: app/Admin/Options.php: 552246 #: app/Admin/Options.php:763 203 247 msgid "Show on WooCommerce Register Form?" 204 248 msgstr "" 205 249 206 #: app/Admin/Options.php: 555250 #: app/Admin/Options.php:766 207 251 msgid "Check to show EthPress register button on the WooCommerce Register Form." 208 252 msgstr "" 209 253 210 #: app/Admin/Options.php:563 211 msgid "Upgrade to keep using the WooCommerce Register Form feature!" 212 msgstr "" 213 214 #: app/Admin/Options.php:567 215 msgid "Upgrade to use the WooCommerce Register Form feature!" 216 msgstr "" 217 218 #: app/Admin/Options.php:578 app/Admin/Options.php:655 254 #: app/Admin/Options.php:789 app/Admin/Options.php:866 219 255 msgid "" 220 256 "Check the Administration > Settings > General > Membership: Anyone can " … … 222 258 msgstr "" 223 259 224 #: app/Admin/Options.php: 618260 #: app/Admin/Options.php:829 225 261 msgid "WooCommerce Checkout Page Register Form" 226 262 msgstr "" 227 263 228 #: app/Admin/Options.php: 629264 #: app/Admin/Options.php:840 229 265 msgid "Show on the WooCommerce Checkout page?" 230 266 msgstr "" 231 267 232 #: app/Admin/Options.php: 632268 #: app/Admin/Options.php:843 233 269 msgid "Check to show EthPress register button on the WooCommerce Checkout page." 234 270 msgstr "" 235 271 236 #: app/Admin/Options.php:640 237 msgid "Upgrade to keep using the WooCommerce Register on a Checkout page feature!" 238 msgstr "" 239 240 #: app/Admin/Options.php:644 241 msgid "Upgrade to use the WooCommerce Register on a Checkout page feature!" 242 msgstr "" 243 244 #: app/Admin/Options.php:719 272 #: app/Admin/Options.php:906 273 msgid "WooCommerce Account Details Link Wallet Form" 274 msgstr "" 275 276 #: app/Admin/Options.php:917 277 msgid "Show the Link Wallet button on the WooCommerce Account Details page?" 278 msgstr "" 279 280 #: app/Admin/Options.php:920 281 msgid "Check to the Link Wallet button on the WooCommerce Account Details page." 282 msgstr "" 283 284 #: app/Admin/Options.php:1017 245 285 msgid "Settings" 246 286 msgstr "" 247 287 248 #: app/Front.php: 28 app/Front.php:74288 #: app/Front.php:31 app/Front.php:151 249 289 msgid "Enable JavaScript to log in with a crypto wallet." 250 msgstr ""251 252 #: app/Front.php:60253 msgid "Log In With a Crypto Wallet"254 msgstr ""255 256 #: app/Front.php:106257 msgid "Register With a Crypto Wallet"258 290 msgstr "" 259 291 … … 304 336 msgstr "" 305 337 306 #: app/Login.php:3 5338 #: app/Login.php:39 307 339 msgid "Invalid input" 308 340 msgstr "" 309 341 310 #: app/Login.php: 63 app/Plugin.php:191342 #: app/Login.php:77 app/Plugin.php:199 311 343 msgid "Logged in" 312 344 msgstr "" 313 345 314 #: app/Login.php: 70346 #: app/Login.php:84 315 347 msgid "Signature err, try again." 316 348 msgstr "" 317 349 318 #: app/Login.php:1 27350 #: app/Login.php:146 319 351 #. translators: blog name. 320 352 msgid "Log in to %1$s" 321 353 msgstr "" 322 354 323 #: app/Login.php:1 61355 #: app/Login.php:181 324 356 msgid "Bad nonce, please refresh." 325 357 msgstr "" 326 358 327 #: app/Login.php:1 68359 #: app/Login.php:188 328 360 msgid "No address specified." 329 361 msgstr "" 330 362 331 #: app/Plugin.php:1 85363 #: app/Plugin.php:193 332 364 msgid "Choose your login method" 333 365 msgstr "" 334 366 335 #: app/Plugin.php:1 86367 #: app/Plugin.php:194 336 368 msgid "Error: cannot detect crypto wallet" 337 369 msgstr "" 338 370 339 #: app/Plugin.php:1 87371 #: app/Plugin.php:195 340 372 msgid "Waiting for your permission" 341 373 msgstr "" 342 374 343 #: app/Plugin.php:1 88375 #: app/Plugin.php:196 344 376 msgid "Fetching login phrase..." 345 377 msgstr "" 346 378 347 #: app/Plugin.php:1 89379 #: app/Plugin.php:197 348 380 msgid "Waiting for your signature" 349 381 msgstr "" 350 382 351 #: app/Plugin.php:19 0383 #: app/Plugin.php:198 352 384 msgid "Verifying signature..." 353 385 msgstr "" 354 386 355 #: app/Plugin.php: 192387 #: app/Plugin.php:200 356 388 msgid "Login aborted" 357 389 msgstr "" 358 390 359 #: app/Plugin.php: 193391 #: app/Plugin.php:201 360 392 msgid "Log In" 361 393 msgstr "" 362 394 363 #: app/Plugin.php: 194395 #: app/Plugin.php:202 364 396 msgid "Scan a QR code with your wallet, https://walletconnect.org" 365 397 msgstr "" 366 398 367 #: app/Plugin.php: 195399 #: app/Plugin.php:203 368 400 msgid "Browser add-on and mobile app, https://metamask.io" 369 401 msgstr "" 370 402 371 #: app/Plugin.php:2 48403 #: app/Plugin.php:256 372 404 msgid "Log out first" 373 405 msgstr "" 374 406 375 #: app/Widgets/Button.php:3 1407 #: app/Widgets/Button.php:34 376 408 msgid "EthPress Widget" 377 409 msgstr "" 378 410 379 #: app/Widgets/Button.php:70 380 msgid "Link Your Crypto Wallets" 381 msgstr "" 382 383 #: app/Widgets/Button.php:87 411 #: app/Widgets/Button.php:84 384 412 msgid "Title:" 385 413 msgstr "" -
ethpress/trunk/readme.txt
r2768291 r2775563 1 1 === EthPress - Web3 Login === 2 Contributors: lynn999, ethereumicoio 2 Contributors: lynn999, ethereumicoio, freemius 3 3 Donate link: https://etherscan.io/address/0x106417f7265e15c1aae52f76809f171578e982a9 4 4 Tags: login, metamask, ethereum, web3, trust wallet, bitcoin, cryptocurrency, crypto wallet, walletconnect 5 5 Requires at least: 4.6 6 6 Tested up to: 6.0.1 7 Stable tag: 1.5.1 17 Stable tag: 1.5.12 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 28 28 * A web3 login button is added to your login screen automatically 29 29 * Use the EthPress widget for maximum ease 30 * Alternatively, a shortcode [ethpress_login_button] can be used 30 * A shortcode [ethpress_login_button] can be used to display the Login button anywhere 31 * A shortcode [ethpress_link_button] can be used to display the Link accounts button anywhere 31 32 * Local signature verification. To verify signatures locally with JavaScript, see this [guide](https://gitlab.com/losnappas/verify-eth-signature) please. 32 * Managed Verification Service. [PRO](https://ethereumico.io/product/web3-login-wordpress-ethpress-plugin/) version required. [Free 7 days Trial](https://checkout.freemius.com/mode/dialog/plugin/9248/plan/15558/?trial=paid) available! 33 * EthPress login button on a [WooCommerce](https://woocommerce.com/?aff=12943&cid=17113767) Login, Register and Checkout Forms. [PRO](https://ethereumico.io/product/web3-login-wordpress-ethpress-plugin/) version required. [Free 7 days Trial](https://checkout.freemius.com/mode/dialog/plugin/9248/plan/15558/?trial=paid) available! 34 * The [ethpress_account] short code can be used to display the current user’s address logged with. [PRO](https://ethereumico.io/product/web3-login-wordpress-ethpress-plugin/) version required. [Free 7 days Trial](https://checkout.freemius.com/mode/dialog/plugin/9248/plan/15558/?trial=paid) available! 35 * [NFT](https://ethereumico.io/product/nft-wordpress-plugin/) Token based access control for [WooCommerce](https://woocommerce.com/?aff=12943&cid=17113767) products, simple pages and posts can be done with the [EthPress NFT Access Add-On](https://ethereumico.io/product/nft-authentication-nft-access-control-wordpress-plugin/). [Free 7 days Trial](https://checkout.freemius.com/mode/dialog/plugin/10731/plan/18172/?trial=paid) available! 33 34 == Features PRO == 35 36 > The [EthPress PRO](https://ethereumico.io/product/web3-login-wordpress-ethpress-plugin/) version is required to use these features. [Free 7 days Trial](https://checkout.freemius.com/mode/dialog/plugin/9248/plan/15558/?trial=paid) is available! 37 38 * Managed Verification Service. 39 * EthPress login button on a [WooCommerce](https://woocommerce.com/?aff=12943&cid=17113767) Login, Register and Checkout Forms. 40 * The [ethpress_account] short code can be used to display the current user’s address logged with. 41 * Buttons labels text can be changed in plugin settings 42 * WooCommerce Account Details show Link Wallet button setting 43 * The `Redirect URL` setting can be used to set an URL of a page to redirect after a successful login 44 45 > The [NFT](https://ethereumico.io/product/nft-wordpress-plugin/) Token based access control for the [WooCommerce](https://woocommerce.com/?aff=12943&cid=17113767) products, simple pages and posts can be done with the [EthPress NFT Access Add-On](https://ethereumico.io/product/nft-authentication-nft-access-control-wordpress-plugin/). [Free 7 days Trial](https://checkout.freemius.com/mode/dialog/plugin/10731/plan/18172/?trial=paid) is available! 36 46 37 47 [More Q&A](https://gitlab.com/losnappas/ethpress/-/blob/master/README-EXTRA.md). … … 140 150 141 151 The `login_redirect` hook is a [standard WordPress hook](https://developer.wordpress.org/reference/hooks/login_redirect/) you can use to customize the page user should be redirected after login. 152 153 > The [EthPress PRO](https://ethereumico.io/product/web3-login-wordpress-ethpress-plugin/) version has a feature to configure it on the plugin settings page. [Free 7 days Trial](https://checkout.freemius.com/mode/dialog/plugin/9248/plan/15558/?trial=paid) is available! 142 154 143 155 ` … … 172 184 == Changelog == 173 185 186 187 = 1.5.12 = 188 189 * The `[ethpress_link_button]` shortcode is added 190 * Buttons labels text settings is added 191 * WooCommerce Account Details show Link Wallet button setting is added 192 * The `Redirect URL` setting is added to set an URL of a page to redirect after a successful login 193 174 194 = 1.5.11 = 175 195 -
ethpress/trunk/vendor/autoload.php
r2765503 r2775563 5 5 require_once __DIR__ . '/composer/autoload_real.php'; 6 6 7 return ComposerAutoloaderInitf 4ed892c423fcef463e8c6daa512a46c::getLoader();7 return ComposerAutoloaderInitf3c6553acb34adbc7dfda2e6cecd78e4::getLoader(); -
ethpress/trunk/vendor/composer/autoload_classmap.php
r2754355 r2775563 40 40 'losnappas\\Ethpress\\Nonce' => $baseDir . '/app/Nonce.php', 41 41 'losnappas\\Ethpress\\Plugin' => $baseDir . '/app/Plugin.php', 42 'losnappas\\Ethpress\\Shortcodes\\LinkButton' => $baseDir . '/app/Shortcodes/LinkButton.php', 42 43 'losnappas\\Ethpress\\Shortcodes\\LoggedAccount' => $baseDir . '/app/Shortcodes/LoggedAccount.php', 43 44 'losnappas\\Ethpress\\Shortcodes\\LoginButton' => $baseDir . '/app/Shortcodes/LoginButton.php', -
ethpress/trunk/vendor/composer/autoload_real.php
r2765503 r2775563 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInitf 4ed892c423fcef463e8c6daa512a46c5 class ComposerAutoloaderInitf3c6553acb34adbc7dfda2e6cecd78e4 6 6 { 7 7 private static $loader; … … 23 23 } 24 24 25 spl_autoload_register(array('ComposerAutoloaderInitf 4ed892c423fcef463e8c6daa512a46c', 'loadClassLoader'), true, true);25 spl_autoload_register(array('ComposerAutoloaderInitf3c6553acb34adbc7dfda2e6cecd78e4', 'loadClassLoader'), true, true); 26 26 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); 27 spl_autoload_unregister(array('ComposerAutoloaderInitf 4ed892c423fcef463e8c6daa512a46c', 'loadClassLoader'));27 spl_autoload_unregister(array('ComposerAutoloaderInitf3c6553acb34adbc7dfda2e6cecd78e4', 'loadClassLoader')); 28 28 29 29 $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); … … 31 31 require __DIR__ . '/autoload_static.php'; 32 32 33 call_user_func(\Composer\Autoload\ComposerStaticInitf 4ed892c423fcef463e8c6daa512a46c::getInitializer($loader));33 call_user_func(\Composer\Autoload\ComposerStaticInitf3c6553acb34adbc7dfda2e6cecd78e4::getInitializer($loader)); 34 34 } else { 35 35 $map = require __DIR__ . '/autoload_namespaces.php'; -
ethpress/trunk/vendor/composer/autoload_static.php
r2765503 r2775563 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInitf 4ed892c423fcef463e8c6daa512a46c7 class ComposerStaticInitf3c6553acb34adbc7dfda2e6cecd78e4 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 55 55 'losnappas\\Ethpress\\Nonce' => __DIR__ . '/../..' . '/app/Nonce.php', 56 56 'losnappas\\Ethpress\\Plugin' => __DIR__ . '/../..' . '/app/Plugin.php', 57 'losnappas\\Ethpress\\Shortcodes\\LinkButton' => __DIR__ . '/../..' . '/app/Shortcodes/LinkButton.php', 57 58 'losnappas\\Ethpress\\Shortcodes\\LoggedAccount' => __DIR__ . '/../..' . '/app/Shortcodes/LoggedAccount.php', 58 59 'losnappas\\Ethpress\\Shortcodes\\LoginButton' => __DIR__ . '/../..' . '/app/Shortcodes/LoginButton.php', … … 65 66 { 66 67 return \Closure::bind(function () use ($loader) { 67 $loader->prefixLengthsPsr4 = ComposerStaticInitf 4ed892c423fcef463e8c6daa512a46c::$prefixLengthsPsr4;68 $loader->prefixDirsPsr4 = ComposerStaticInitf 4ed892c423fcef463e8c6daa512a46c::$prefixDirsPsr4;69 $loader->classMap = ComposerStaticInitf 4ed892c423fcef463e8c6daa512a46c::$classMap;68 $loader->prefixLengthsPsr4 = ComposerStaticInitf3c6553acb34adbc7dfda2e6cecd78e4::$prefixLengthsPsr4; 69 $loader->prefixDirsPsr4 = ComposerStaticInitf3c6553acb34adbc7dfda2e6cecd78e4::$prefixDirsPsr4; 70 $loader->classMap = ComposerStaticInitf3c6553acb34adbc7dfda2e6cecd78e4::$classMap; 70 71 71 72 }, null, ClassLoader::class);
Note: See TracChangeset
for help on using the changeset viewer.