���� JFIF    �� �        "" $(4,$&1'-=-157:::#+?D?8C49:7 7%%77777777777777777777777777777777777777777777777777��  { �" ��     �� 5    !1AQa"q�2��BR��#b�������  ��  ��   ? ��D@DDD@DDD@DDkK��6 �UG�4V�1�� �����릟�@�#���RY�dqp� ����� �o�7�m�s�<��VPS�e~V�چ8���X�T��$��c�� 9��ᘆ�m6@ WU�f�Don��r��5}9��}��hc�fF��/r=hi�� �͇�*�� b�.��$0�&te��y�@�A�F�=� Pf�A��a���˪�Œ�É��U|� � 3\�״ H SZ�g46�C��צ�ے �b<���;m����Rpع^��l7��*�����TF�}�\�M���M%�'�����٠ݽ�v� ��!-�����?�N!La��A+[`#���M����'�~oR�?��v^)��=��h����A��X�.���˃����^Ə��ܯsO"B�c>; �e�4��5�k��/CB��.  �J?��;�҈�������������������~�<�VZ�ꭼ2/)Í”jC���ע�V�G�!���!�F������\�� Kj�R�oc�h���:Þ I��1"2�q×°8��Р@ז���_C0�ր��A��lQ��@纼�!7��F�� �]�sZ B�62r�v�z~�K�7�c��5�.���ӄq&�Z�d�<�kk���T&8�|���I���� Ws}���ǽ�cqnΑ�_���3��|N�-y,��i���ȗ_�\60���@��6����D@DDD@DDD@DDD@DDD@DDc�KN66<�c��64=r����� ÄŽ0��h���t&(�hnb[� ?��^��\��â|�,�/h�\��R��5�? �0�!צ܉-����G����٬��Q�zA���1�����V��� �:R���`�$��ik��H����D4�����#dk����� h�}����7���w%�������*o8wG�LycuT�.���ܯ7��I��u^���)��/c�,s�Nq�ۺ�;�ך�YH2���.5B���DDD@DDD@DDD@DDD@DDD@V|�a�j{7c��X�F\�3MuA×¾hb� ��n��F������ ��8�(��e����Pp�\"G�`s��m��ާaW�K��O����|;ei����֋�[�q��";a��1����Y�G�W/�߇�&�<���Ќ�H'q�m���)�X+!���=�m�ۚ丷~6a^X�)���,�>#&6G���Y��{����"" """ """ """ """ ""��at\/�a�8 �yp%�lhl�n����)���i�t��B�������������?��modskinlienminh.com - WSOX ENC ‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*!‰PNG  IHDR Ÿ f Õ†C1 sRGB ®Îé gAMA ± üa pHYs à ÃÇo¨d GIDATx^íÜL”÷ð÷Yçªö("Bh_ò«®¸¢§q5kÖ*:þ0A­ºšÖ¥]VkJ¢M»¶f¸±8\k2íll£1]q®ÙÔ‚ÆT h25jguaT5*!class-capability-manager-wp.php000066600000002331151733470440012550 0ustar00capabilities as $capability => $roles ) { $filtered_roles = $this->filter_roles( $capability, $roles ); $wp_roles = $this->get_wp_roles( $filtered_roles ); foreach ( $wp_roles as $wp_role ) { $wp_role->add_cap( $capability ); } } } /** * Unregisters the capabilities from the system. * * @return void */ public function remove() { // Remove from any roles it has been added to. $roles = wp_roles()->get_names(); $roles = array_keys( $roles ); foreach ( $this->capabilities as $capability => $_roles ) { $registered_roles = array_unique( array_merge( $roles, $this->capabilities[ $capability ] ) ); // Allow filtering of roles. $filtered_roles = $this->filter_roles( $capability, $registered_roles ); $wp_roles = $this->get_wp_roles( $filtered_roles ); foreach ( $wp_roles as $wp_role ) { $wp_role->remove_cap( $capability ); } } } } class-abstract-capability-manager.php000066600000004360151733470440013731 0ustar00capabilities[ $capability ] ) ) { $this->capabilities[ $capability ] = $roles; return; } // Combine configurations. $this->capabilities[ $capability ] = array_merge( $roles, $this->capabilities[ $capability ] ); // Remove doubles. $this->capabilities[ $capability ] = array_unique( $this->capabilities[ $capability ] ); } /** * Returns the list of registered capabilitities. * * @return string[] Registered capabilities. */ public function get_capabilities() { return array_keys( $this->capabilities ); } /** * Returns a list of WP_Role roles. * * The string array of role names are converted to actual WP_Role objects. * These are needed to be able to use the API on them. * * @param array $roles Roles to retrieve the objects for. * * @return WP_Role[] List of WP_Role objects. */ protected function get_wp_roles( array $roles ) { $wp_roles = array_map( 'get_role', $roles ); return array_filter( $wp_roles ); } /** * Filter capability roles. * * @param string $capability Capability to filter roles for. * @param array $roles List of roles which can be filtered. * * @return array Filtered list of roles for the capability. */ protected function filter_roles( $capability, array $roles ) { /** * Filter: Allow changing roles that a capability is added to. * * @param array $roles The default roles to be filtered. */ $filtered = apply_filters( $capability . '_roles', $roles ); // Make sure we have the expected type. if ( ! is_array( $filtered ) ) { return []; } return $filtered; } } class-capability-utils.php000066600000004536151733470440011663 0ustar00 $applicable_roles ] ); } /** * Retrieves the roles that have the specified capability. * * @param string $capability The name of the capability. * * @return array The names of the roles that have the capability. */ public static function get_applicable_roles( $capability ) { $roles = wp_roles(); $role_names = $roles->get_names(); $applicable_roles = []; foreach ( array_keys( $role_names ) as $role_name ) { $role = $roles->get_role( $role_name ); if ( ! $role ) { continue; } // Add role if it has the capability. if ( array_key_exists( $capability, $role->capabilities ) && $role->capabilities[ $capability ] === true ) { $applicable_roles[] = $role_name; } } return $applicable_roles; } /** * Checks if the current user has at least one of the supplied capabilities. * * @param array $capabilities Capabilities to check against. * * @return bool True if the user has at least one capability. */ protected static function has_any( array $capabilities ) { foreach ( $capabilities as $capability ) { if ( self::has( $capability ) ) { return true; } } return false; } /** * Checks if the user has a certain capability. * * @param string $capability Capability to check against. * * @return bool True if the user has the capability. */ protected static function has( $capability ) { return current_user_can( $capability ); } } class-register-capabilities.php000066600000006344151733470440012656 0ustar00register( 'wpseo_bulk_edit', [ 'editor', 'wpseo_editor', 'wpseo_manager' ] ); $manager->register( 'wpseo_edit_advanced_metadata', [ 'editor', 'wpseo_editor', 'wpseo_manager' ] ); $manager->register( 'wpseo_manage_options', [ 'administrator', 'wpseo_manager' ] ); $manager->register( 'view_site_health_checks', [ 'wpseo_manager' ] ); } /** * Revokes the 'wpseo_manage_options' capability from administrator users if it should * only be granted to network administrators. * * @param array $allcaps An array of all the user's capabilities. * @param array $caps Actual capabilities being checked. * @param array $args Optional parameters passed to has_cap(), typically object ID. * @param WP_User $user The user object. * * @return array Possibly modified array of the user's capabilities. */ public function filter_user_has_wpseo_manage_options_cap( $allcaps, $caps, $args, $user ) { // We only need to do something if 'wpseo_manage_options' is being checked. if ( ! in_array( 'wpseo_manage_options', $caps, true ) ) { return $allcaps; } // If the user does not have 'wpseo_manage_options' anyway, we don't need to revoke access. if ( empty( $allcaps['wpseo_manage_options'] ) ) { return $allcaps; } // If the user does not have 'delete_users', they are not an administrator. if ( empty( $allcaps['delete_users'] ) ) { return $allcaps; } $options = WPSEO_Options::get_instance(); if ( $options->get( 'access' ) === 'superadmin' && ! is_super_admin( $user->ID ) ) { unset( $allcaps['wpseo_manage_options'] ); } return $allcaps; } /** * Maybe add manage_privacy_options capability for wpseo_manager user role. * * @param string[] $caps Primitive capabilities required of the user. * @param string[] $cap Capability being checked. * * @return string[] Filtered primitive capabilities required of the user. */ public function map_meta_cap_for_seo_manager( $caps, $cap ) { $user = wp_get_current_user(); // No multisite support. if ( is_multisite() ) { return $caps; } if ( ! is_array( $user->roles ) ) { return $caps; } // User must be of role wpseo_manager. if ( ! in_array( 'wpseo_manager', $user->roles, true ) ) { return $caps; } // Remove manage_options cap requirement if requested cap is manage_privacy_options. if ( $cap === 'manage_privacy_options' ) { return array_diff( $caps, [ 'manage_options' ] ); } return $caps; } } class-capability-manager-factory.php000066600000001373151733470440013576 0ustar00capabilities as $capability => $roles ) { $role_capabilities = $this->get_role_capabilities( $role_capabilities, $capability, $roles ); } foreach ( $role_capabilities as $role => $capabilities ) { wpcom_vip_add_role_caps( $role, $capabilities ); } } /** * Removes the registered capabilities from the system * * @return void */ public function remove() { // Remove from any role it has been added to. $roles = wp_roles()->get_names(); $roles = array_keys( $roles ); $role_capabilities = []; foreach ( array_keys( $this->capabilities ) as $capability ) { // Allow filtering of roles. $role_capabilities = $this->get_role_capabilities( $role_capabilities, $capability, $roles ); } foreach ( $role_capabilities as $role => $capabilities ) { wpcom_vip_remove_role_caps( $role, $capabilities ); } } /** * Returns the roles which the capability is registered on. * * @param array $role_capabilities List of all roles with their capabilities. * @param string $capability Capability to filter roles for. * @param array $roles List of default roles. * * @return array List of capabilities. */ protected function get_role_capabilities( $role_capabilities, $capability, $roles ) { // Allow filtering of roles. $filtered_roles = $this->filter_roles( $capability, $roles ); foreach ( $filtered_roles as $role ) { if ( ! isset( $add_role_caps[ $role ] ) ) { $role_capabilities[ $role ] = []; } $role_capabilities[ $role ][] = $capability; } return $role_capabilities; } }