{"id":28926919,"url":"https://github.com/chamilo/chamilo-wordpress","last_synced_at":"2026-03-14T17:09:58.133Z","repository":{"id":14424518,"uuid":"63113468","full_name":"chamilo/chamilo-wordpress","owner":"chamilo","description":"Chamilo integration plugin for Wordpress","archived":false,"fork":false,"pushed_at":"2022-04-25T06:26:38.000Z","size":24,"stargazers_count":10,"open_issues_count":3,"forks_count":11,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-12T06:29:43.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chamilo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-12T00:58:45.000Z","updated_at":"2025-05-27T05:46:35.000Z","dependencies_parsed_at":"2022-07-22T12:32:52.041Z","dependency_job_id":null,"html_url":"https://github.com/chamilo/chamilo-wordpress","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chamilo/chamilo-wordpress","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilo%2Fchamilo-wordpress","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilo%2Fchamilo-wordpress/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilo%2Fchamilo-wordpress/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilo%2Fchamilo-wordpress/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chamilo","download_url":"https://codeload.github.com/chamilo/chamilo-wordpress/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chamilo%2Fchamilo-wordpress/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260204252,"owners_count":22974103,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-22T12:12:37.598Z","updated_at":"2026-03-14T17:09:53.081Z","avatar_url":"https://github.com/chamilo.png","language":"PHP","readme":"# chamilo-wordpress\nChamilo integration plugin for Wordpress\n\n## Install\n\nTo install this plugin from source, do the following inside the wp-content/plugins/ directory:\n```\ngit clone https://github.com/chamilo/chamilo-wordpress chamilo\n```\n\nThen go to your Wordpress plugins panel and go to the \"Reading\" settings page.\nLocate the \"Chamilo connectivity\" section and add your Chamilo URL (like \"http://my.chamilo.net/\"), the admin username (\"admin\" or any other username you might have set) and the security key (find it in your app/config/configuration.php by looking for \"security_key\").\n\n### Configuring the courses list widget\n\nGo to the widgets section of your Wordpress configuration panel and locate the \"Chamilo Courses list\" widget. Place it somewhere useful (drag \u0026 drop).\n\nThat's it! Now you can see the list of courses from your portal (depending on where you placed the widget).\n\n### Configuring the attributes in Woocommerce to put the course code or session id to subscribe user\nGo to Products/Attributes, create a new with name CHAMILOCODE and other with name CHAMILOSESSIONID\n\n### Shortcode to list your list of courses\nYou can put the shortcode [chamilo_courses_list_by_user] to show a list of course of the user logged in.\nTo work, you need to add a few lines in /main/webservices/user_info.soap.php\n\ndefine('WS_ERROR_SECRET_KEY', 1);\ndefine('WS_ERROR_NOT_FOUND_RESULT', 2);\ndefine('WS_ERROR_INVALID_INPUT', 3);\ndefine('WS_ERROR_SETTING', 4);\n/**\n * @param string $code\n *\n * @return null|soap_fault\n */\nfunction returnError($code)\n{\n    $fault = null;\n    switch ($code) {\n        case WS_ERROR_SECRET_KEY:\n            $fault = new soap_fault(\n                'Server',\n                '',\n                'Secret key is not correct or params are not correctly set'\n            );\n            break;\n        case WS_ERROR_NOT_FOUND_RESULT:\n            $fault = new soap_fault(\n                'Server',\n                '',\n                'No result was found for this query'\n            );\n            break;\n        case WS_ERROR_INVALID_INPUT:\n            $fault = new soap_fault(\n                'Server',\n                '',\n                'The input variables are invalid o are not correctly set'\n            );\n            break;\n        case WS_ERROR_SETTING:\n            $fault = new soap_fault(\n                'Server',\n                '',\n                'Please check the configuration for this webservice'\n            );\n            break;\n    }\n\n    return $fault;\n}\n\nfunction WSHelperVerifyKey($params)\n{\n    global $_configuration, $debug;\n    if (is_array($params)) {\n        $secret_key = $params['secret_key'];\n    } else {\n        $secret_key = $params;\n    }\n    //error_log(print_r($params,1));\n    $check_ip = false;\n    $ip_matches = false;\n    $ip = trim($_SERVER['REMOTE_ADDR']);\n    // if we are behind a reverse proxy, assume it will send the\n    // HTTP_X_FORWARDED_FOR header and use this IP instead\n    if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {\n        list($ip1) = explode(',', $_SERVER['HTTP_X_FORWARDED_FOR']);\n        $ip = trim($ip1);\n    }\n    if ($debug) {\n        error_log(\"ip: $ip\");\n    }\n    // Check if a file that limits access from webservices exists and contains\n    // the restraining check\n    if (is_file('webservice-auth-ip.conf.php')) {\n        include 'webservice-auth-ip.conf.php';\n        if ($debug) {\n            error_log(\"webservice-auth-ip.conf.php file included\");\n        }\n        if (!empty($ws_auth_ip)) {\n            $check_ip = true;\n            $ip_matches = api_check_ip_in_range($ip, $ws_auth_ip);\n            if ($debug) {\n                error_log(\"ip_matches: $ip_matches\");\n            }\n        }\n    }\n\n    if ($debug) {\n        error_log(\"checkip \".intval($check_ip));\n    }\n\n    if ($check_ip) {\n        $security_key = $_configuration['security_key'];\n    } else {\n        $security_key = $ip.$_configuration['security_key'];\n        //error_log($ip.'-'.$secret_key.'-'.$security_key);\n    }\n\n    $result = api_is_valid_secret_key($secret_key, $security_key);\n\n    if ($debug) {\n        error_log('WSHelperVerifyKey result: '.intval($result));\n    }\n\n    return $result;\n}\n````````````\nAnd change the function WSCourseListOfUser to that code\n\n````````````\nfunction WSCourseListOfUser($username, $signature)\n{\n  \t$params['secret_key'] = $signature;\n  \n  \tif (!WSHelperVerifyKey($params)) {\n        return returnError(WS_ERROR_SECRET_KEY);\n    }\n  \n    if (empty($username) or empty($signature)) {\n        return -1;\n    }\n    $info = api_get_user_info_from_username($username);\n    $user_id = $info['user_id'];\n    \n\n    $courses_list = [];\n    $courses_list_tmp = CourseManager::get_courses_list_by_user_id($user_id);\n    foreach ($courses_list_tmp as $index =\u003e $course) {\n        $course_info = CourseManager::get_course_information($course['code']);\n        $courses_list[] = [\n            'code' =\u003e $course['code'],\n            'title' =\u003e api_utf8_encode($course_info['title']),\n            'url' =\u003e api_get_path(WEB_COURSE_PATH).$course_info['directory'].'/',\n            'teacher' =\u003e api_utf8_encode($course_info['tutor_name']),\n            'language' =\u003e $course_info['course_language'],\n        ];\n    }\n\n    return $courses_list;\n}\n\n## Roadmap\n\nIn the future, we will add:\n- a personal list of courses (not all the public ones but just yours)\n- a way to create accounts in Chamilo when they're created in Wordpress\n- a way to do Single Sign On (avoid double authentication in Wordpress and Chamilo)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchamilo%2Fchamilo-wordpress","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchamilo%2Fchamilo-wordpress","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchamilo%2Fchamilo-wordpress/lists"}