| @@ -35,9 +35,9 @@ | ||
| 35 | 35 | add_action( 'groups_admin_menu', array( __CLASS__, 'groups_admin_menu' ) ); |
| 36 | 36 | // @todo temporary fix for GFA <= 1.0.11 on localized installations - can be removed when all are updated |
| 37 | 37 | if ( defined( 'GFA_VIEWS_LIB' ) ) { |
| 38 | 38 | if ( file_exists( GFA_VIEWS_LIB . '/class-gfa-help.php' ) ) { |
| 39 | - include_once( GFA_VIEWS_LIB . '/class-gfa-help.php' ); | |
| 39 | + include_once GFA_VIEWS_LIB . '/class-gfa-help.php'; | |
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | add_filter( 'admin_footer_text', array( __CLASS__, 'admin_footer_text' ) ); |
| @@ -59,17 +59,17 @@ | ||
| 59 | 59 | */ |
| 60 | 60 | public static function contextual_help() { |
| 61 | 61 | if ( $screen = get_current_screen() ) { |
| 62 | 62 | $show_groups_help = false; |
| 63 | - $help_title = __( 'Groups', GROUPS_PLUGIN_DOMAIN ); | |
| 63 | + $help_title = _x( 'Groups', 'Help title', 'groups' ); | |
| 64 | 64 | $screen_id = $screen->base; |
| 65 | 65 | // The prefix of the $screen_id is translated, use only the suffix |
| 66 | 66 | // to identify a screen: |
| 67 | 67 | $ids = array( |
| 68 | - 'groups-admin' => __( 'Groups', GROUPS_PLUGIN_DOMAIN ), | |
| 69 | - 'groups-admin-groups' => __( 'Groups', GROUPS_PLUGIN_DOMAIN ), | |
| 70 | - 'groups-admin-options' => __( 'Options', GROUPS_PLUGIN_DOMAIN ), | |
| 71 | - 'groups-admin-capabilities' => __( 'Capabilities', GROUPS_PLUGIN_DOMAIN ), | |
| 68 | + 'groups-admin' => _x( 'Groups', 'Help tab title and heading', 'groups' ), | |
| 69 | + 'groups-admin-groups' => _x( 'Groups', 'Help tab title and heading', 'groups' ), | |
| 70 | + 'groups-admin-options' => _x( 'Options', 'Help tab title and heading', 'groups' ), | |
| 71 | + 'groups-admin-capabilities' => _x( 'Capabilities', 'Help tab title and heading', 'groups' ), | |
| 72 | 72 | ); |
| 73 | 73 | foreach ( $ids as $id => $title ) { |
| 74 | 74 | $i = strpos( $screen_id, $id ); |
| 75 | 75 | if ( $i !== false ) { |
| @@ -81,16 +81,23 @@ | ||
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | if ( $show_groups_help ) { |
| 85 | - $help = '<h3><a href="http://www.itthinx.com/plugins/groups" target="_blank">'. $help_title .'</a></h3>'; | |
| 85 | + $help = '<h3><a href="https://www.itthinx.com/plugins/groups" target="_blank">'. $help_title .'</a></h3>'; | |
| 86 | 86 | $help .= '<p>'; |
| 87 | - $help .= __( 'The complete documentation is available on the <a href="http://docs.itthinx.com/document/groups">Documentation</a> pages for Groups.', GROUPS_PLUGIN_DOMAIN ); | |
| 87 | + $help .= sprintf( | |
| 88 | + /* translators: documentation pages link */ | |
| 89 | + __( 'The complete documentation is available on the %s pages for Groups.', 'groups' ), | |
| 90 | + sprintf( | |
| 91 | + '<a href="https://docs.itthinx.com/document/groups">%s</a>', | |
| 92 | + __( 'Documentation', 'groups' ) | |
| 93 | + ) | |
| 94 | + ); | |
| 88 | 95 | $help .= '</p>'; |
| 89 | 96 | switch ( $screen_id ) { |
| 90 | 97 | case 'groups-admin' : |
| 91 | 98 | case 'groups-admin-groups': |
| 92 | - $help .= '<p>' . __( 'Here you can <strong>add</strong>, <strong>edit</strong> and <strong>remove</strong> groups.', GROUPS_PLUGIN_DOMAIN ) . '</p>'; | |
| 99 | + $help .= '<p>' . __( 'Here you can <strong>add</strong>, <strong>edit</strong> and <strong>remove</strong> groups.', 'groups' ) . '</p>'; | |
| 93 | 100 | break; |
| 94 | 101 | case 'groups-admin-options' : |
| 95 | 102 | case 'groups-admin-capabilities' : |
| 96 | 103 | break; |
| @@ -109,9 +116,10 @@ | ||
| 109 | 116 | |
| 110 | 117 | /** |
| 111 | 118 | * Provides the footer text for Groups on relevant screens. |
| 112 | 119 | * |
| 113 | - * @param string $footer_text | |
| 120 | + * @param string $text | |
| 121 | + * | |
| 114 | 122 | * @return mixed |
| 115 | 123 | */ |
| 116 | 124 | public static function admin_footer_text( $text ) { |
| 117 | 125 | if ( function_exists( 'get_current_screen' ) ) { |
| @@ -133,22 +141,31 @@ | ||
| 133 | 141 | /** |
| 134 | 142 | * Returns or renders the footer. |
| 135 | 143 | * |
| 136 | 144 | * @param boolean $render |
| 145 | + * | |
| 146 | + * @return string|null | |
| 137 | 147 | */ |
| 138 | 148 | public static function footer( $render = true ) { |
| 139 | 149 | $footer = |
| 140 | 150 | '<span class="groups-footer">' . |
| 141 | - __( 'Thank you for using <a href="http://www.itthinx.com/plugins/groups" target="_blank">Groups</a> by <a href="http://www.itthinx.com" target="_blank">itthinx</a>.', GROUPS_PLUGIN_DOMAIN ) . | |
| 151 | + sprintf( | |
| 152 | + /* translators: 1: link 2: link */ | |
| 153 | + __( 'Thank you for using %1$s by %2$s.', 'groups' ), | |
| 154 | + '<a href="https://www.itthinx.com/plugins/groups" target="_blank">Groups</a>', | |
| 155 | + '<a href="https://www.itthinx.com" target="_blank">itthinx</a>' | |
| 156 | + ) . | |
| 142 | 157 | ' ' . |
| 143 | 158 | sprintf( |
| 144 | - __( 'Please give it a <a href="%s">★★★★★</a> rating.', GROUPS_PLUGIN_DOMAIN ), | |
| 145 | - esc_attr( 'http://wordpress.org/support/view/plugin-reviews/groups?filter=5#postform' ) | |
| 159 | + /* translators: link */ | |
| 160 | + __( 'Please give it a <a href="%s">★★★★★</a> rating.', 'groups' ), | |
| 161 | + esc_attr( 'https://wordpress.org/support/view/plugin-reviews/groups?filter=5#postform' ) | |
| 146 | 162 | ) . |
| 147 | 163 | '</span>'; |
| 148 | 164 | $footer = apply_filters( 'groups_footer', $footer ); |
| 149 | 165 | if ( $render ) { |
| 150 | - echo $footer; | |
| 166 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 167 | + echo $footer; // @phpstan-ignore return.missing | |
| 151 | 168 | } else { |
| 152 | 169 | return $footer; |
| 153 | 170 | } |
| 154 | 171 | } |